Sourcetree Compare

  1. Sourcetree Compare Files Between Branches
  2. Sourcetree External Diff
  3. Sourcetree Side By Side Diff
  4. Sourcetree Diff
  5. Gitkraken Compare 2 Branches
  6. Sourcetree Beyond Compare

macOS only

Beyond Compare can be configured as the external difference utility in many popular VCS applications. The following are configuration instructions submitted by our users. Let us know if you have one to add to the list.

Index:
Cornerstone SVNGitGit ForkIntelliJ IDEA 12Mercurial 2.4.2PerforceSmartCVSSmartGitSmartSVNSourceTreeSubversionSyncovery MacTower (Git)

  • Atlassian SourceTree is most compared with Bitbucket, Bitbucket Server, Helix Core, Git and IBM Rational ClearCase, whereas GitHub is most compared with AWS CodeCommit, Helix Core, Apache Subversion and IBM Rational ClearCase. We monitor all Version Control reviews to prevent fraudulent reviews and keep review quality high.
  • SourceTree is ranked 9th while Git for Windows is ranked 15th. The most important reason people chose SourceTree is: In addition to color-coded branches and icons that tell if a file has been added, removed or modified, SourceTree also displays the number of commits that.
  • SmartGit is ranked 1st while SourceTree is ranked 9th. The most important reason people chose SmartGit is: SmartGit can be used free of charge by Open Source developers, teachers and their students, or for hobby, non-paid usage.
  • Atlassian SourceTree is ranked 4th in Version Control with 1 review while Bitbucket is ranked 1st in Version Control with 6 reviews. Atlassian SourceTree is rated 8.0, while Bitbucket is rated 8.4. The top reviewer of Atlassian SourceTree writes 'User-friendly, easy to scale, and it helps to fix problems with our code repository'.

Cornerstone SVN

GitKraken and SourceTree can be categorized as 'Source Code Management Desktop Apps' tools. 'Dark theme' is the primary reason why developers consider GitKraken over the competitors, whereas 'Visual history and branch view' was stated as the key factor in picking SourceTree.

In Cornerstone, you can specify a custom external compare script.

Sourcetree Compare Files Between Branches

Launch Beyond Compare, go to the Beyond Compare menu and run Install Command Line Tools.

DIFF

Create an AppleScript wrapper for use by Cornerstone:

Set in PreferencesGeneralExternal compare toolOther Script..

Git

Git 2.3 and newer

(Note: Use bc3 on the command line for BC version 4. Caused by git legacy support from Linux.)

Launch Beyond Compare, go to the Beyond Compare menu and run Install Command Line Tools.

Diff

In a terminal:Compare

Sourcetree External Diff

git config --global diff.tool bc3

To launch a diff using Beyond Compare, use the command: git difftool file.ext

Merge

In a terminal:
git config --global merge.tool bc3
git config --global mergetool.bc3.trustExitCode true

To launch a 3-way merge using Beyond Compare, use the command: git mergetool file.ext


Older versions of Git

  1. Launch Beyond Compare, go to the Beyond Compare menu and run Install Command Line Tools.
  2. Add the following lines to $HOME/.gitconfig:
    [diff]
    tool = bcomp
    [difftool]
    prompt = false
    [difftool 'bcomp']
    trustExitCode = true
    cmd = '/usr/local/bin/bcomp' '$LOCAL' '$REMOTE'
    [merge]
    tool = bcomp
    [mergetool]
    prompt = false
    [mergetool 'bcomp']
    trustExitCode = true
    cmd = '/usr/local/bin/bcomp' '$LOCAL' '$REMOTE' '$BASE' '$MERGED'
  3. To launch a diff in Beyond Compare, use: git difftool file.ext
    To launch a merge in Beyond Compare, use: git mergetool file.ext

Sourcetree Side By Side Diff

Git Fork

Launch Beyond Compare, go to the Beyond Compare menu and run Install Command Line Tools.

Diff

Sourcetree Compare
  1. Select Preferences from the Fork menu.
  2. Select Integration.
  3. Select 'Beyond Compare' from the External Diff Tool drop down.

Merge

  1. Select Preferences from the Fork menu.
  2. Select Integration.
  3. Select 'Beyond Compare' from the Merge Tool drop down.

IntelliJ IDEA

(Potentially, also RubyMine, Webstorm, PyCharm, PhpStorm)

The first step is to launch Beyond Compare, go to the Beyond Compare menu and run Install Command Line Tools.

In IntelliJ's Settings dialog, under IDE Settings, select the External Diff Tools section:

Compare folders
Path to executable: /usr/local/bin/bcomp
Compare files
Path to executable: /usr/local/bin/bcomp

Sourcetree Diff

Merge tool
Path to executable: /usr/local/bin/bcomp
Parameters: %1 %2 %3 %4

Mercurial 2.4.2

Launch Beyond Compare, go to the Beyond Compare menu and run Install Command Line Tools.

Perforce

Launch Beyond Compare, go to the Beyond Compare menu and run Install Command Line Tools.

Diff

  1. Go to the P4V menu and select Preferences.
  2. Go to the Diff section and select Other application.
  3. Location: /usr/local/bin/bcomp
  4. Arguments: %1 %2

Merge

  1. Go to the P4V menu and select Preferences.
  2. Go to the Merge section and select Other application.
  3. Location: /usr/local/bin/bcomp
  4. Arguments: %1 %2 %b %r

SmartCVS

  1. Launch Beyond Compare, go to the Beyond Compare menu and run Install Command Line Tools.
  2. Launch SmartCVS, select PreferencesFile Comparators.
  3. Select * in the table and click edit.
  4. Add /usr/local/bin/bcomp in Command and ${leftFile} ${rightFile} in Arguments.
  5. Click OK.

SmartGit

Launch Beyond Compare, go to the Beyond Compare menu and run Install Command Line Tools.

Sourcetree Compare

Diff

  1. Select SmartGitPreferences.
  2. Go to Tools > Diff Tools.
  3. Click Add.
  4. File Pattern: *
  5. Select External diff tool.
  6. Command: /usr/local/bin/bcomp
  7. Arguments: -readonly -lefttitle=${leftTitle} -righttitle=${rightTitle} ${leftFile} ${rightFile}

Merge

  1. Select SmartGitPreferences.
  2. Go to Tools > Conflict Solvers.
  3. Click Add.
  4. File Pattern: *
  5. Select External Conflict Solver.
  6. Command: /usr/local/bin/bcomp
  7. Arguments: ${leftFile} ${rightFile} ${baseFile} -mergeoutput=${mergedFile}

SmartSVN

  1. Launch Beyond Compare, go to the Beyond Compare menu and run Install Command Line Tools.
  2. Launch SmartSVN, select PreferencesFile Comparators.
  3. Select * in the table and click edit.
  4. Add /usr/local/bin/bcomp in Command and ${leftFile} ${rightFile} in Arguments.
  5. Click OK.

SourceTree

From the Beyond Compare menu, Install Command Line Tools. Then:

Subversion

Launch Beyond Compare, go to the Beyond Compare menu and run Install Command Line Tools. Tempur pedic chair tp8000.

Diff

Create a file named /usr/local/bin/bcdiff.sh and allow execute permissions (chmod +x). Add the following lines:
/usr/local/bin/bcomp '$6' '$7' -title1='$3' -title2='$5' -readonly
exit 0

Edit $HOME/.subversion/config and add the line diff-cmd = /usr/local/bin/bcdiff.sh in [Helpers].

Merge

Create a file named /usr/local/bin/bcmerge.sh and allow execute permissions (chmod +x). Add the following line:
/usr/local/bin/bcomp '$2' '$3' '$1' '$4'

Gitkraken Compare 2 Branches

Edit $HOME/.subversion/config and add the line merge-tool-cmd = /usr/local/bin/bcmerge.sh in [Helpers].

Syncovery Mac

Sourcetree Beyond Compare

The first step is to launch Beyond Compare, go to the Beyond Compare menu and run Install Command Line Tools.

Then to configure Syncovery:

  1. Select menu Syncovery/Preferences.
  2. Click the Misc tab.
  3. In the field Program used to compare files from the Sync Preview, write /usr/local/bin/bcompare (or the pathname given when using BC4's Install Command Line Tools).
  4. Click Close.

Tower (Git)

(Requires Tower 2.0.5 or newer)
  1. Launch Beyond Compare, go to the Beyond Compare menu and run Install Command Line Tools.
  2. Open Tower's preferences dialog on the Git Config Tab.
  3. Set the Diff Tool drop-down to Beyond Compare.
  4. Set the Merge tool drop-down to Beyond Compare.

I used to use Diffmerge for my merge/comparison needs, however I find the outdated interface to be unfriendly and ugly to look at.

On Windows I use Sourcetree and Beyond Compare works without integration, it shows up in the appropriate dropdowns but on Mac it does not. I don’t understand why Sourcetree on Mac is different to Windows, but anyway.

Fortunately, Sourcetree makes it easy to use third party comparison tools even if they are not in the dropdowns.

Firstly, we need to install Beyond Compare “Command Line Tools” which allows us to call Beyond Compare.

Go into the Beyond Compare menu and choose Install Command Line Tools.

Secondly we need to configure Sourcetree to use the command line for Beyond Compare:

In Preferences and then the “Diff” tab, at the bottom there is a section which allows you to specify the compare tool.