Using Beyond Compare 4 Mac Beta with Git

A little over a year ago I wrote a post about using Beyond Compare on Mac via Wine. A native version is now in beta and open to everyone! If you haven't tried Beyond Compare, I suggest you do. If you have you already know how awesome it is.

I've been testing the Alpha for many months now and thought I'd throw together some instructions for getting it going with git.

You can download the beta here: http://www.scootersoftware.com/beta.php

After you have the App installed, the next step is to install the command line tools. All other steps require this.

From the App, go to the "Beyond Compare" drop down menu and choose "Install Command Line Tools...". It will then prompt you for your password. After this, you bcomp file1.txt file2.txt

Using with Git CLI

The next step is to set it up as a git diff tool and merge tool. Git already has native support for it built in thanks to the Linux client having existed for years now.

This can be achieved simply by running the following commands.

$ git config --global diff.tool bc3
$ git config --global difftool.prompt false
$ git config --global merge.tool bc3

This simple setup will leave git diff and git merge functioning as usual, as well as allowing you to use Beyond Compare for the task by doing git difftool and git mergetool.

I highly recommend giving Beyond Compare a go as a merge tool next time you need to do a merge as it makes it wonderfully simple (when you understand whats going on with the 4 sections anyway).

Using with Tower 1.x

Update: Tower 2.0.6+ include built in support for Beyond Compare which the following instructions will interfere with.

Quit Tower

Navigate to ~/Library/Application\ Support/Tower

Create a CompareScripts folder if one does not already exist.

Download bcomp.sh and place it in the new CompareScripts folder.

Make it executable via chmod +x bcomp.sh

Download CompareTools.plist and place it in the ~/Library/Application\ Support/Tower directory. Rename / move any old version that might exist.

Using with SourceTree

Open SourceTree

Open "Preferences" from the SourceTree menu

Along the top bar, choose the "Diff" tab.

Under External Diff / Merge

for Visual Diff Tool choose Other then in the Diff Command enter /usr/local/bin/bcomp and for Arguments enter $LOCAL $REMOTE

For Merge Tool choose Other and in Merge Command enter /usr/local/bin/bcomp and for Arguments enter $LOCAL $REMOTE $BASE $MERGED