Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use the diff tool of Visual Studio 2012 in Sourcetree?

Stefan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2013

I would like to use the diff tool of visual studio 2012 with Sourcetree. Is there a way to do that?

4 answers

1 accepted

4 votes
Answer accepted
Stefan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2013

Ok, now I have it:

  1. Tools > Options > Diff
  2. Change 'External Diff Tool' to 'Custom'
  3. Set 'Diff Command' to 'path\to\devenv' (e.g. C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe)
  4. Set 'Arguments' to '-Diff $LOCAL $REMOTE' (works with '-' or '/' on command line, SourceTree needs '-')
  5. Click OK
  6. restart SourceTree

(Now it would be great if it would use an existing visual studio window and won't open a new one)

1 vote
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2013

You should be able to use it like so:

  1. Tools > Options > Diff
  2. Change 'External Diff Tool' to 'Custom'
  3. Set 'Diff Command' to 'path\to\devenv'
  4. Set 'Arguments' to '$LOCAL $REMOTE'
  5. Click OK

However unfortunately there's a bug with using 'Custom' setup right now, I've fixed this but only for 0.9.1.2+. We're having some issues with out CDN which are delaying getting this update out, but once this is resolved you should be able to get 0.9.1.2 and use this option.

Stefan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2013

Ok, now I have version 0.9.1.2 - but It doesn't work...

If I open a command promt and use this command I get a diff window:

>"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" /Diff C:\Users\Stefan\AppData\Local\Temp\aiT4ea_WaveGraphRenderer.vb c:\Users\Stefan\Documents\WaveGraphRenderer.vb

But if I set the arguments in SourceTree to '/Diff $LOCAL $REMOTE' visual studio opens, the two files are opened in the IDE, but the diff window is not shown and I get the following error:

---------------------------
Microsoft Visual Studio
---------------------------
The following files were specified on the command line:

    C:/Program Files (x86)/Git/Diff

These files could not be found and will not be loaded.
---------------------------
OK  
---------------------------

Any idea?


Ciao!
Stefan

P.S.: SourceTree has to be restartet after every change in the options menu.

0 votes
Reagan Cooper
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 24, 2015

Thanks Stefan, this works great for diffs. But how can I use this for merges? Is there a switch for devenv.exe for merge or should I use the vsdiffmerge.exe with these args: 

$REMOTE $LOCAL $BASE $MERGED //m
0 votes
Johannes Ebner April 2, 2015

Above solutions do not work correctly. The only solution I have found which truly works, is this:

 

https://github.com/Inmeta/Knowledge/wiki/Setting-Up-DiffMerge

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events