Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save srikanthlavudia/14922d67b27fd03f0d52 to your computer and use it in GitHub Desktop.
Save srikanthlavudia/14922d67b27fd03f0d52 to your computer and use it in GitHub Desktop.
  1. Download SourceGear DiffMerge: http://sourcegear.com/diffmerge/index.html

  2. Add the following to your global .gitconfig file:

     [diff]
         tool = DiffMerge
     [difftool "DiffMerge"]
         cmd = 'C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe' "$LOCAL" "$REMOTE"
     [merge]
         tool = DiffMerge
     [mergetool "DiffMerge"]
         cmd = 'C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe' -merge -result="$PWD/$MERGED" "$PWD/$LOCAL" "$PWD/$BASE" "$PWD/$REMOTE"
         trustExitCode = true
     [mergetool]
         keepBackup = false
    

After following these steps, you can run git difftool and git mergetool to open SourceGear DiffMerge from the Git Bash prompt.

@srikanthlavudia
Copy link
Author

This also works fine according to : https://gist.github.com/mkchandler/2377564
[diff]
tool = diffmerge
[merge]
tool = diffmerge
[difftool "diffmerge"]
cmd = 'C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe' "$LOCAL" "$REMOTE"
[mergetool "diffmerge"]
cmd = 'C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe' -merge -result="$PWD/$MERGED" "$PWD/$LOCAL" "$PWD/$BASE" "$PWD/$REMOTE"
trustExitCode = true
keepBackup = false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment