Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git merge using the vs2012 diff tool

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.

like image 663
CodeSpeaker Avatar asked Oct 07 '22 14:10

CodeSpeaker


1 Answers

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.

like image 59
sschuberth Avatar answered Oct 10 '22 02:10

sschuberth