Space Cat, Prince Among Thieves

Use Beyond Compare as a Git Diff/Merge Tool in OS X

I switched from Windows to Mac for work a little over a year ago (I've been using Macs at home for years) and there is one program I still could not live without - Scooter Software's wonderful Beyond Compare. I've tried every single diff tool available and none have lived up to Beyond Compare. It truly lives up to its name.

I've had Beyond Compare running in WineBottler for a while now, but was never able to get passing arguments to work correctly. Today I had a revelation. On creating the bottle it asks you for arguments to pass the executable, I had not provided any. Ends up it then passes the first argument as an empty string, which prevented the first argument being a file! Huzzah, an easy fix, pass it an innocuous argument! So here are some directions on getting it set up!

Beyond Compare Installation / Configuration

The first step is to download WineBottler if you don't already have it. Just drag the WineBottler.app and Wine.app into your /Applications directory. Then download the Windows version of the Beyond Compare Installer and hang onto it.

Launch WineBottler.app. In the left pane choose "Create Custom Prefixes", then for the Install File, choose the Beyond Compare Installer downloaded earlier. To my knowledge no Winetricks are necessary. Check the Self-contained checkbox to make a stand alone application.

IMPORTANT: WineBottler passes a blank argument if you leave the Runtime Arguments blank, which Beyond Compare interprets as the first filename - an annoying bug that took me months to figure out. To get around this we can pass it an innocuous argument (see arguments). I chose /nobackups because I don't want backups and they are turned off by default anyway.

Click Install. It will ask you to save your App, do so in /Applications. I named mine as BeyondCompare.app and paths later will reflect this.

Follow the installer. After the installer completes Beyond Compare may pop up if you've left the launch checkbox checked. Just close the window. Choose BCompare.exe when it asks you for the default executable (BComp.exe is for batch scripting).

Git Configuration

The paths in the following presume you named your app BeyondCompare.app so these may be adjusted as necessary.

Add the following to your ~/.gitconfig file. Remove anything existing that contradicts these settings. I've named the diff and merge tools bc3wb as git already has baked in support for the Windows version, which it calls bc3.

Beyond Compare 3 Professional

[diff]
    tool = bc3wb
[difftool "bc3wb"]
    cmd = /Applications/BeyondCompare.app/Contents/MacOS/WineBottlerStarter \"$LOCAL\" \"$PWD/$REMOTE\"
[merge]
    tool = bc3wb
[mergetool "bc3wb"]
    cmd = /Applications/BeyondCompare.app/Contents/MacOS/WineBottlerStarter \"$PWD/$LOCAL\" \"$PWD/$REMOTE\" \"$PWD/$BASE\" \"$PWD/$MERGED\"
    keepBackup = false
    trustExitCode = false

Beyond Compare 2 / 3 Standard

[diff]
    tool = bc3wb
[difftool "bc3wb"]
    cmd = /Applications/BeyondCompare.app/Contents/MacOS/WineBottlerStarter \"$LOCAL\" \"$PWD/$REMOTE\"

Note: I am unable to get the mergetool portion working in Beyond Compare 2 or 3 Standard as WineBottler is interpreting /savepath= as a filepath and converting it to z:\savepath= rather than properly passing the arguments. If anyone has any advice on how to fix this I would be ecstatic.

Voila, now you can git mergetool and git difftool it up!


Read More / Comment »

Last.fm donatJ

Vampire Weekend - Modern Vampires of the City
Tom Waits - Glitter and Doom Live
Jack White - Blunderbuss
Freezepop - Imaginary Friends
Eels - Electro-Shock Blues Show
My Bloody Valentine - Isn't Anything
Elliott Smith - New Moon
Eels - Useless Trinkets: B-Sides, Soundtracks, Rarities And Unreleased
Eels - Blinking Lights And Other Revelations

Instagram donatJ

He totally did!
Vegas

Flickr donatJ

STP80617
STP80616
STP81015
STP81006
STP81005
STP81004
STP80967
STP80961

Twitter @donatJ

OH "Dropping it like I don't understand it"
Link

I'm in the Google Maps beta, it's prettier but less useful. Seems to be the trend now days.
Link

Nice Branding, Microsoft. Xbox One - really? What do I call the first generation then?
Link

Recent Comments

i keep getting the following notice Undefined offset: 1 to 31 "Notice: Undefined offset: 1 in SimpleCalendar.php on line 150"
Link

$calendar->setStartOfWeek('Sunday'); works perfectly. Thanks for the update! :)
Link

Would it be possible to graph two at a time? For example, creating a race track would require a circle proportional to another inside the outer one thus needing…
Link

How to change the first day of the week is detailed in the 'sample usage'...
Link

I am developing a shape builder for the computercraft mod. A few users have mentioned that smaller circles don't look circular, and I agree. Your circles are wa…
Link

Tag Cloud