Setting git diff to use diffmerge

1.4k Views Asked by At

I wanted to set my git to use diffmerge as the default diff editor instead of the default Unix diff:

git config --global diff.external diffmerge

Undfortunately, when I did

git diff myfile.txt

I got the following error out of DiffMerge (in the form of a popup):

Unexpected parameter '100644'

Command Line Arguments:
[0]: /Applications/DiffMerge.app/Contents/MacOS/DiffMerge
[1]: --nosplash
[2]: myfile.txt
[3]: /var/folders/_r/xjwgmj811yq5x7n7mb9z0pzc0000gn/T//pNIOTmyfile.txt
[4]: 95cbe334d3ec607ca7f7bd3fd16d630271e9d0af
[5]: 100644
[6]: myfile.txt
[7]: 0000000000000000000000000000000000000000
[8]: 100644

Can you tell what I am doing wrong?

1

There are 1 best solutions below

6
On

Use this instead

git config --global diff.tool diffmerge
git config --global difftool.diffmerge.cmd "diffmerge \$LOCAL \$REMOTE"

There is plenty of blog posts and articles explaining how to configure diffmerge as default diff or merge tool. See http://adventuresincoding.com/2010/04/how-to-setup-git-to-use-diffmerge/ for example