2

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

1
  • I think what I'm looking for is the "folder diffs" that Mercurial and DiffMerge allows, and for some reason git doesn't, or I don't know how to set that up. Commented Aug 15, 2011 at 19:26

4 Answers 4

1

You should have the following lines in your .gitconfig:

[diff]
    tool = diffmerge
[difftool "diffmerge"]
    cmd = /Applications/DiffMerge.app/Contents/MacOS/DiffMerge \"$LOCAL\" \"$REMOTE\"
Sign up to request clarification or add additional context in comments.

Comments

1

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.

1 Comment

Perfect. This is exactly what I was looking for. Its too bad git doesn't inherently handle folder diffs.
1

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

2 Comments

How will that work with a 3 way merge tool such as DiffMerge?
@Bryan git diff and difftool are about two-way diffs (as mentioned in stackoverflow.com/questions/7251477/… and stackoverflow.com/questions/3635788/…). That option won't concern mergetool, which will show a three-way diff, but without using the difftool setting (hence ignoring the new difftool option --dir-diff).
0

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

Problem with git + DiffMerge on OS X

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.