Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code for Mac as diff/merge tool in Sourcetree

Is there a way that I can set Visual Studio Code as the default diff/merge tool in Sourcetree on Mac?

like image 250
ozzotto Avatar asked Oct 16 '17 12:10

ozzotto


People also ask

How do I set the diff tool in SourceTree?

SourceTree config First, open up the options window and go to Diff tab. Change both External Diff Tool and Merge Tool to Custom. In the Diff Command field enter the full path to the vsdiffmerge.exe. For VS 2015 and below you can find it in the Visual Studio installation folder, under Common7\IDE subfolder.

Does VSCode have a diff tool?

Our Git tooling supports viewing of diffs within VS Code. Tip: You can diff any two files by first right clicking on a file in the Explorer or OPEN EDITORS list and selecting Select for Compare and then right-click on the second file to compare with and select Compare with 'file_name_you_chose'.

Does SourceTree have a merge tool?

SourceTree is configured to use DiffMerge as the External Diff Tool and as the Merge Tool.


2 Answers

You need to do below configuration in Sourcetree

  • Go to Sourcetree → PreferencesDiff
  • In the section External Diff / Merge, select Custom for the Visual Diff Tool and Merge Tool
  • Diff Arguments → --diff --wait "$LOCAL" "$REMOTE"

  • Merge Arguments → -n --wait "$MERGED"

  • After configuration is saved, then goto the Sourcetree and right click on the file with merge conflicts Resolve ConflictsLaunch External Merge Tool

Note: Diff and Merge command should point to /usr/local/bin/code and not code otherwise it will not work

Sourcetree external diff/merge tool configuration Step to resolve conflict in source tree

like image 87
Swapnil Avatar answered Sep 20 '22 22:09

Swapnil


I found this with instructions on how to get it to work on the Mac. I wasn't able to get it to work until I used the full path to the code executable (I also set code in my global path)

/usr/local/bin/code
like image 42
bcr Avatar answered Sep 24 '22 22:09

bcr