The diff tool in Visual Studio when using the Git Plugin

Deadly 提交于 2019-12-02 19:07:08

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

Steps :

  1. Install Winmerge with "WinMerge added to your PATH environment variable", you have to select the check box during winmerge installation.

  2. Microsoft GIT provider plugin should be installed in visual studio 2013.

  3. Go to user git config, generally in "C:\Users\USERNAME\.gitconfig"

  4. Add the following lines or update according to parameters inside .gitconfig

**

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

**

Now from Visual studio if you do "Compare with Unmodified..." on a file winmerge should open up automatically.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!