使用 Git 插件时 Visual Studio 中的差异工具
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16674503/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The diff tool in Visual Studio when using the Git Plugin
提问by JosephStyons
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.
微软已经发布了一个用于 Visual Studio 2012的Git 插件。我发现它非常好,但似乎没有任何选项可以更改默认的 Diff 工具。更糟糕的是,我根本无法对 ascx 代码隐藏文件进行比较。它只显示主 .ASCX 文件的差异选项。
How do you
你怎么
- Diff the codebehind files when using the git plugin?
- Change the diff tool?
- 使用 git 插件时区分代码隐藏文件?
- 更改差异工具?
回答by kenwarner
You have to change your local .gitconfig, rather than make the change through Visual Studio as you would with TFS
您必须更改本地 .gitconfig,而不是像使用 TFS 那样通过 Visual Studio 进行更改
https://gist.github.com/mkchandler/2377564
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
回答by Saket
Steps :
脚步 :
Install Winmerge with "WinMerge added to your PATH environment variable", you have to select the check box during winmerge installation.
Microsoft GIT provider plugin should be installed in visual studio 2013.
Go to user git config, generally in "C:\Users\USERNAME\.gitconfig"
Add the following lines or update according to parameters inside .gitconfig
使用“将WinMerge 添加到您的 PATH 环境变量”安装 Winmerge ,您必须在 winmerge 安装过程中选中该复选框。
Microsoft GIT 提供程序插件应安装在 Visual Studio 2013 中。
转到用户git config,一般在“ C:\Users\USERNAME\.gitconfig”
添加以下几行或根据 .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.
现在从 Visual Studio 如果您对文件执行“与未修改的比较...”,则 winmerge 应该会自动打开。