Using external Diff/Merge in Sourcetree

9/18/14, 11:33:12 AM

This tutorial is made for you if

  • you use a source control system like Git or Github
  • you use Sourcetree a the UI client to work with your repositories
  • you have to merge changes in your various branches
  • you have to solve conflicts when merging

Today I asked myself: how to use an external Diff/Merge tool in Sourcetree? When you open the options of Sourcetree you will find the section for defining an external tool deactivated like this:

As external tools are defined for Git and not for Sourcetree you have to allow Sourcetree itself to modify the .gitconfig file to use an external editor. You can find this important setting in the first tab of the options:

I chose DiffMerge as the external tool to view, merge and save the files that conflicted during the merge of separate branches. You can download it for free here: https://sourcegear.com/diffmerge/

Once you allowed Sourcetree to set the external tool in the Git config you are able to choose it from the list of tools:

As this tool is known by Sourcetree no additional configuration for the command line is necessary.

So if you ever face a conflict while merging a branch into your own you can chose DiffMerge as the external tool to do it.

 





Latest comments to this post

borrot wrote on 12.01.2015, 09:49

Oliver, is there a way to use DiffMerge as a tool just to see differences between commits? It works while merging but I cannot find an option to use it for regular commits comparison. 

 Reply to this comment
 Link to this comment

Leave a comment right here