سؤال

In git when I have a conflict, I've been either using 'git mergetool' which then indirectly brings up meld with a 3 pane interface, or I've also brought up meld directly by using 'meld <path to file with conflict>'. When I use the latter method, it brings up meld with only 2 panes. I prefer the 3 pane interface but the issue with the 'git mergetool' is that it leaves behind '.orig' files that I then have to clean up. Can someone explain this difference in behavior (2 vs 3 panes) and how I can avoid having to do the extra cleanup of the .orig files?

هل كانت مفيدة؟

المحلول

The difference in behavior is a result of the fact that git does only put conflict info about the two branches being merged into the conflict file by default. The information about the mergebase is left out of there. You can change that behaviour by running

git config --global merge.conflictstyle diff3

I do not know whether meld can handle that. But that doesn’t really matter as you should run the conflict resolution via git mergetool -y anyways. The problem with the .orig files can be resolved by running (as knittl already pointed out)

git config --global mergetool.keepBackup false

Note the --global – this is important, otherwise the setting will only be changed for the current repo.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top