git merge using the vs2012 diff tool

旧巷老猫 提交于 2019-12-07 06:09:17

问题


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.

Im currently using TortoiseGit and BeyondCompare.


回答1:


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.

For merging, I guess I have to disappoint you, devenv /diff only accepts exactly two files.



来源:https://stackoverflow.com/questions/12507396/git-merge-using-the-vs2012-diff-tool

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