Git shouldn't "insists on removing them" but should instead report it as a conflict, which you should now resolve in the way you want. If you did some "bad things" earlier in the past, Git may be fooled by an odd history structure and may solve conflicts in a wrong way. Also, if you use rerere
, then maybe it remembers some wrong merge snippets and they are now reused to skip past these conflicts. You may want to review and repair such things..
But, anyways, if git merge
doesn't give you a chance to solve conflicts manually, you can always add a --no-commit --no-ff
flags to git merge
command, and after git merge
you will be able to correct the files and commit the merge manually. After that it should be OK and future merges shouldn't have problems in this parts of this files.
..hm.. unless you are merging a separate repositories/branches which don't share any history. In your Git repo, you have your codebase based on their remote code, right? Or have you copied the code without tracking information? Or maybe you previously used squash merges to merge their changes in? Anyways, it should be reported as conflict. If it is - that's normal. Just solve the conflict.