Configuring WinMerge as a Diff / merge tool in Visual Studio 2015

I want to install WinMerge as the default comparison tool in VS 2015, and I cannot do it globally. I need to edit my local file [solution dir] /. Git / config), and it works fine, but when I try to do it everywhere, editing the file ([User folder] /. Gitconfig), it does not work in VS 2015 (using the standard VS diff tool). Its a little annoying to apply these settings every time I add a new solution for Git.

Here is my configuration

[diff] tool = winmerge [difftool] prompt = true [difftool "winmerge"] path = d:\\WinMerge\\winmergeu.exe cmd = \"d:\\WinMerge\\WinMergeU.exe\" \"$LOCAL\" \"$REMOTE\" [merge] tool = winmerge [mergetool] prompt = true [mergetool "winmerge"] path = d:\\WinMerge\\winmergeu.exe cmd = \"d:\\WinMerge\\winmergeu.exe\" -u -e -dl \"Local\" -dr \"Remote\" $LOCAL $REMOTE $MERGED 
+7
git visual-studio-2015 winmerge
source share
3 answers

I have VS2015 SP1 and WinMerge in my path, nothing is set in my .git / config solution and the following in .gitconfig (under C: \ users \ username) and it works:

 [diff] tool = winmerge [difftool "winmerge"] cmd = winmergeu.exe -e -ub -x -wl -u -maximise -dl "base" -dr "mine" \"$LOCAL\" \"$REMOTE\" 
+12
source share

In addition to what @gezzahead said (and I added the guitool entry just for good measure), I found that in the domain policy I created two β€œhome” directories and therefore two .gitconfigs - a) the default C window : \ users \ jsmith \ .gitconfig and H: \. gitconfig (my H: drive is a mapped drive so that an IT call calls my "home folder").

After I created a symbolic link using something like below (you will need to edit it), Visual Studio raised WinMerge.

 mklink H:\.gitconfig C:\users\jsmith\.gitconfig 

Just for completeness, I ran Win10 x64, update VS 2015, and below is a list of my configuration (slightly censored)

 PS> git config --global --list user.name=John Smith user.email=jsmith@example.com diff.tool=winmerge diff.guitool=winmerge difftool.winmerge.path=c:/Program Files (x86)/winmerge/winmergeu.exe difftool.winmerge.cmd=winmergeu.exe /e /x /u /wl /maximize -dl base -dr mine "$LOCAL" "$REMOTE" 
+1
source share

A solution with .gitconfig works like magic (VS 2015). However, Windows Explorer refuses to rename the file to .gitconfig . I used command line renaming.

 ren aaa ".gitconfig" 

No need to restart Visual Studio.

-one
source share

All Articles