The diff tool in Visual Studio when using the Git Plugin

JosephStyons picture JosephStyons · May 21, 2013 · Viewed 12.6k times · Source

Microsoft has released a Git plugin for Visual Studio 2012. I have found it to be excellent, but there doesn't seem to be any option to change the default Diff tool. Worse, I cannot do a diff at all on ascx codebehind files. It only shows a diff option for the main .ASCX file.

How do you

  1. Diff the codebehind files when using the git plugin?
  2. Change the diff tool?

Answer

kenwarner picture kenwarner · Jun 8, 2013

You have to change your local .gitconfig, rather than make the change through Visual Studio as you would with TFS

https://gist.github.com/mkchandler/2377564

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