Skip to content

Use VS Diff tool with Git and SourceTree

DKaramfilov edited this page Dec 16, 2015 · 1 revision

It is quite complex to configure that using git config command, therefore, you should blindly trust on the following configuration and append it to your global .gitconfig file (typically located in C:\Users\[UserName]).

Note: The following is applicable for VS 2015. If you are using different version make sure to correct the path to the vsdiffmerge.exe file.

Important: This code will override the SourceTree configurations. It is suggested to backup your original .gitconfig file.

.gitconfig

[diff]
	tool = vsdiffmerge
[difftool]
	prompt = true
[difftool "vsdiffmerge"]
	cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\vsdiffmerge.exe\" //t \"$LOCAL\" \"$REMOTE\"
	keepbackup = false
	trustexistcode = true
[merge]
	tool = vsdiffmerge
[mergetool]
	prompt = true
[mergetool "vsdiffmerge"]
	cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\vsdiffmerge.exe\" //m \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\" 
	keepbackup = false
	trustexistcode = true
[difftool "sourcetree"]
	cmd = 'C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/vsdiffmerge.exe' //t $LOCAL $REMOTE
	keepbackup = false
	trustexistcode = true
[mergetool "sourcetree"]
	cmd = 'C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/vsdiffmerge.exe' //m $REMOTE $LOCAL $BASE $MERGED
	keepbackup = false
	trustExitCode = true
Clone this wiki locally