Bryan
Bryan

Reputation: 624

git with DiffMerge setup to mimic Mercurials setup with diffmerge

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

Upvotes: 2

Views: 324

Answers (4)

VonC
VonC

Reputation: 1323953

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."

Upvotes: 1

Tim Henigan
Tim Henigan

Reputation: 62168

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.

Upvotes: 1

Edward Thomson
Edward Thomson

Reputation: 78653

You should have the following lines in your .gitconfig:

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

Upvotes: 1

Gerry
Gerry

Reputation: 11164

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

Problem with git + DiffMerge on OS X

Upvotes: 0

Related Questions