difftool has a great user friendly option for viewing diffs. Its the --dir-diff option - allowing you to abritrarly browse through two directories.
The git mergetool has a very clumsy and unfriendly userinterface. Solving merge conflicts has to be done in a strict order given by git.
Is there a possibility to setup a similar option like $ git difftool --dir-diff? say $ git mergetool --dir-merge calling the directory compare of e.g. winmerge? Or do one has an alternativ solution to provide a user friendly interface for solving multiple file merge conflicts?
There is a simple Python program called meld, but anything that visualises merges with three panes will do.
To use it for merge resolution, have it installed and, while in an unresolved-merge in git, type: $ git mergetool
.
More on a topic you can read at: Painless Merge Conflict Resolution in Git
...I have found that the tools and interfaces available for performing merges do not equip programmers sufficiently to do them effectively. Often, a programmer will simply run git merge and hope that git will take care of the large majority of the hunks. Of the hunks that conflict, the usual merge strategy of the human at the helm is to use the surrounding context to roughly guess what the intended program is supposed to look like.
This article will hopefully demonstrate that there can be a much more measured process to the resolution of merge conflicts which takes the guesswork out of this risky operation...
You can pass in a list of files to git mergetool
'
To get a list of unmerged files, you can use git ls-files --unmerged $DIR
'
In summary, do
git mergetool `git ls-files --unmerged $DIR`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With