Skip to content

Instantly share code, notes, and snippets.

@rustle
Created November 20, 2012 01:45
Show Gist options
  • Save rustle/4115414 to your computer and use it in GitHub Desktop.
Save rustle/4115414 to your computer and use it in GitHub Desktop.
Source Tree with Kaleidoscope 2 beta

SourceTree does not yet officially support Kaleidoscope 2, so here is how to set it up:

In Preferences, under Diff:

Screen Shot

You can try selecting Kaleidoscope, but we have had reports of mixed results. Some people have rebuilt their launch services database and restarted and been able to use Kaleidoscope this way:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain use

Otherwise you can directly configure ksdiff for diffing:

Visual Diff Tool select Other with Diff Command

/usr/local/bin/ksdiff

and Arguments

-- "$LOCAL" "$REMOTE"

You'll need to set up merge as Other until SourceTree supports Kaleidoscope directly:

Merge Tool select Other with Merge Command

/usr/local/bin/ksdiff

and Arguments

--merge --output "$MERGED" --base "$BASE" -- "$LOCAL" "$REMOTE"

That's it, you should be clear to diff and merge away.

In testing, we found that sometimes SourceTree won't save edits to commands or arguments and that you may have to select a different tool then reselect Other to make the changes stick.

We've also found the Mac App Store version of SourceTree doesn't seem to call ksdiff at all when you're using the Other configuration. We'll update if we find more on this.

@epicycle
Copy link

My local SourceTree wouldn't let me edit ANY of the diff/merge settings or drop downs until I uninstalled the AppStore version and downloaded it again from their website. After that your directions for the Other installed worked flawlessly. Thanks!

@epicycle
Copy link

I don't know if it's an issue with SourceTree or this command line but when I select multiple files and open the diff merge tool instead of opening all of the diffs in 1 window it opens a separate window for each diff. For a few files this isn't an issue but with many diffs across many files its kinda crazy and unusable.

@docsteveharris
Copy link

Ditto epicycle. Had to download the website version, and close, and reopen everything.
Thanks for the walkthrough.

@fk
Copy link

fk commented Jan 20, 2013

In order access the options in Preferences → Diff → External Diff/Merge I had to enable
Preferences → General → Allow SourceTree to modify your global Mercurial and Git configuration files.

SourceTree (1.5.6 from the App Store) then wrote those settings to the global ~/.gitconfig; do a git config --global --edit or open ~/.gitconfig to verify their presence (or add them manually):

[difftool "sourcetree"]
    cmd = /usr/local/bin/ksdiff -- \"$LOCAL\" \"$REMOTE\"
    path = 
[mergetool "sourcetree"]
    cmd = /usr/local/bin/ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" \"$REMOTE\"
    trustExitCode = true

Interestingly though when disabling Preferences → General → Allow SourceTree to modify your global Mercurial and Git configuration files, "External Diff" stops working.

@mjstallman
Copy link

I couldn't configure Kaleidoscope diff in Sourcetree until I open Kaleidoscope's preferences and tapped the button to install the command line tool ksdiff. After that Sourcetree didn't have any problems for diff or merge.

I have non-app store versions of each (in Mavericks).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment