git with DiffMerge setup to mimic Mercurials setup with diffmerge

341 Views Asked by At

I'm wondering if there is a way to setup git and diffmerge so that when you execute the following command: git difftool diffmerge pops up and shows you a file listing of all the modified files instead of cycling through them via the command-line?

I'm thinking it must be some setting the ~/.gitconfig file. Here is my current ~/.gitconfig:

[merge]
    tool = diffmerge
[mergetool "diffmerge"]
    cmd = /Applications/DiffMerge.app/Contents/MacOS/diffmerge --merge --result=$MERGED $LOCAL $BASE $REMOTE
[mergetool]
    keepBackup = false
[diff]
    tool = diffmerge
[difftool "diffmerge"]
    cmd = /Applications/DiffMerge.app/Contents/MacOS/diffmerge $LOCAL $REMOTE

See below for Mercurials (HG) way of presenting DiffMerge. Mercurial's way of diffmerge

4

There are 4 best solutions below

0
On

Take a look at the question and answer here for details regarding setting up git with diffmerge:

Problem with git + DiffMerge on OS X

0
On

You should have the following lines in your .gitconfig:

[diff]
    tool = diffmerge
[difftool "diffmerge"]
    cmd = /Applications/DiffMerge.app/Contents/MacOS/DiffMerge \"$LOCAL\" \"$REMOTE\"
1
On

Git does not provide directory diffs in its default setup. See this related SO question:

git difftool, open all diff files immediately, not in serial

Also, see the git diffall project on GitHub which implements this feature as an add-on script.

2
On

Note that you now can (git 1.7.11) diff directories (ie display all the files to be compared, before opening the difftool)

See "git difftool to give directory compare?"

In other words, git now does "inherently handle folder diffs."