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.