It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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)

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 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 and use this option.

Ok, now I have version - 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.

Any idea?


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

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

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: 


Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted 12 hours ago in Off-topic

Miscellaneous Monday - Where it all started.

Happy Monday everyone! If you're anything like me, you tend to think a lot about what the future looks like. What are my kids up to in 15 years? Have we solved for climate change? How could TVs poss...

88 views 13 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you