3 ms·
Can anyone point to a good guide and/or tool for resolving merge conflicts?
by psv1 7y ago
Can anyone point to a good guide and/or tool for resolving merge conflicts?
- Asooka 7y agoThe ones listed as options for git mergetool are all good. Personally I use kdiff3, it has a simple interface for choosing conflict resolutions and can often resolve some of them on its own.
- adrianN 7y agoI liked this http://vimcasts.org/episodes/fugitive-vim-resolving-merge-conflicts-with-vimdiff/ http://vimcasts.org/episodes/fugitive-vim-resolving-merge-co...
- coldpie 7y agoSet merge.conflictstyle=diff3!!!! The default merge style is utterly useless, I have no idea why it is the default. diff3 gives you three pieces of information: the status before at the common ancestor; the status on the current branch; and the status on the to-be-merged branch. You can then understand what changes were made on each branch, and decide how to merge them intelligently. Without that common ancestor, it's way way harder to understand what you're looking at.
- dahart 7y agoI’m a fan of using Perforce merge (p4merge) with git. It’s free to download and use, and easy to integrate with git. I remember thinking the UI was weird the first time I used it, but since then I’ve tried a bunch of merge tools and haven’t found something I like more. It shows common ancestor by default, and lets you hand-edit the merge section, which not all merge tools do.
- darepublic 7y agomany modern IDEs will help with this, ie. visual studio code. It will highlight and name the conflicting code by branch. When the conflict occurs you can do git status and the highlighted files are those with a conflict -- at that point you can just navigate there in the code editor of your choice and look for the <<<< blocks. After you get those files into the state you would like then you run 'git commit' to resolve.
- sixstringtheory 7y agoI have used Kaleidoscope [0] for a few years now to resolve merge conflicts, it's a powerful and beautiful app, and the key bindings are great to fly through conflicts and select "mine", "theirs", "mine-then-theirs" or "theirs-then-mine". And you can also hand edit the resolved version. It's also great for git diffs and file/dir diffing, and can be summoned from the command line with `ksdiff`. [0]: https://www.kaleidoscopeapp.com https://www.kaleidoscopeapp.com