gitgithubmergetooldifftooldiffmerge

Why can't I configure an external difftool or mergetool for Git?


I'm trying to configure an external difftool and mergetool for Git under Windows 10.

Everything keeps telling me to type out two Git commands like the ones below. Some say to use a wrapper.sh while others say it's not necessary.

git config --global diff.tool diffmerge

(The second line looks something like this:)

git config --global difftool.diffmerge.cmd "path to sgdm.exe or some_wrapper.sh" $LOCAL $REMOTE**

This doesn't work for me. I've also tried:

git config --global difftool.diffmerge.cmd C:/Program\ Files/SourceGear/Common/DiffMerge/sgdm.exe \"$LOCAL\" \"$REMOTE\"

git config --global difftool.diffmerge.cmd C:/Program\ Files/SourceGear/Common/DiffMerge/sgdm.exe "$LOCAL" "$REMOTE"

git config --global difftool.diffmerge.cmd "C:/Program\ Files/SourceGear/Common/DiffMerge/sgdm.exe $LOCAL $REMOTE"

My config file looks like this:

[filter "lfs"]

        clean = git-lfs clean %f
        smudge = git-lfs smudge %f
        required = true
[user]

        name= John Doe
[diff]

        tool = dm
[difftool]

        prompt = true
[difftool "dm"]

        cmd = \"C:\\Program Files\\SourceGear\\Common\\DiffMerge\\sgdm.exe\" \"$LOCAL\" \"$REMOTE\" //t

What am I doing wrong?


Solution

  • It sounds like you might be happy with a full GUI client. I have used Sourcetree to integrate with external merge tools (on OSX). And infact, Sourcetree's in-built merge tool is great too.