使用vs2012 diff工具合并git [英] git merge using the vs2012 diff tool
问题描述
是否可以在visual studio 2012中使用diff工具和git?
使用devenv / diff fileA fileB我可以调出两个文件之间的差异,但
如何添加第三个(基本文件)以及并排3个视图。
Is it possible to use the diff tool in visual studio 2012 together with git? Using "devenv /diff fileA fileB" i can bring up a diff between two files, but how can i add a third (base file) as well, having 3 views side by side.
我正在使用TortoiseGit和BeyondCompare。
Im currently using TortoiseGit and BeyondCompare.
推荐答案
Git可以配置为使用任何通用的差异工具,不仅是它开箱即用的工具。要调用一个通用diff工具,通过键入 git config - 将
并通过输入 diff.tool
配置变量设置为自定义diff工具别名,例如vs2012 -global diff.tool vs2012 为该diff工具别名创建相应的
。请注意,我使用破折号而不是斜杠作为diff选项来解决MSYS路径修剪问题,幸运的是,devenv也接受了用于命令行选项的破折号。现在,您应该可以通过键入 cmd
变量git config --global difftool.vs2012.cmd< path_to_devenv> -diff$ LOCAL$ REMOTE git difftool
来调用VS2012 diff工具。
Git can be configured to use any generic diff tool, not only the one it knows out of the box. To call a generic diff tool, set the diff.tool
configuration variable to a custom diff tool alias, say "vs2012", by typing git config --global diff.tool vs2012
and create a corresponding cmd
variable for that diff tool alias by typing git config --global difftool.vs2012.cmd <path_to_devenv> -diff "$LOCAL" "$REMOTE"
. Note that I'm using a dash instead of a slash for the "diff" option to work around MSYS path mangling issues, and luckily devenv also accepts dashes for command line options. Now you should be able to call the VS2012 diff tool by typing git difftool
.
为了合并,我想我不得不让你失望, devenv / diff
只能接受两个文件。
For merging, I guess I have to disappoint you, devenv /diff
only accepts exactly two files.
这篇关于使用vs2012 diff工具合并git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!