Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using Visual Studio AS Git Merge Tool
[diff]
tool = vsdiffmerge
[difftool]
prompt = true
[difftool "vsdiffmerge"]
cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\IDE\\vsdiffmerge.exe\" \"$LOCAL\" \"$REMOTE\" //t
keepbackup = false
trustexistcode = true
[merge]
tool = vsdiffmerge
[mergetool]
prompt = true
[mergetool "vsdiffmerge"]
cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\IDE\\vsdiffmerge.exe\" \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\" //m
keepbackup = false
trustexistcode = true
@cdroulers

This comment has been minimized.

Copy link

cdroulers commented Feb 17, 2017

Works great, Thanks!

For VS2015, simply change Microsoft Visual Studio 12.0 to Microsoft Visual Studio 14.0!

@martinfletcher

This comment has been minimized.

Copy link

martinfletcher commented Mar 9, 2017

For VS2017:

cmd = "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsdiffmerge.exe"

@kmcginnes

This comment has been minimized.

Copy link

kmcginnes commented Mar 12, 2017

I found the following to work for VS 2017:

[difftool "visualstudio"]
    cmd = 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/vsdiffmerge.exe' $LOCAL $REMOTE Source Target //ignorespace //t
[mergetool "visualstudio"]
    cmd = 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/vsdiffmerge.exe' $LOCAL $REMOTE $BASE $MERGED //ignorespace //m
    trustExitCode = true
@rosdi

This comment has been minimized.

Copy link

rosdi commented Mar 23, 2017

So is it "$REMOTE\" \"$LOCAL\" or "$LOCAL" "$REMOTE" ? Example shown by @kmcginnes seems more consistent? Or does it even matter?

@peheje

This comment has been minimized.

Copy link

peheje commented Feb 19, 2018

Is there any way to make it work with dir diff? git difftool --dir-diff

@stokedout

This comment has been minimized.

Copy link

stokedout commented Oct 9, 2018

Should trustexistcode exist not be trustexitcode exit ?

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