Kdiff3 + Git = Win

Posted by Rob Kaufman
on Jun 06, 08

On OS X the default merge tool is opendiff... which I have never liked. So I don't use it. Instead, I use the vastly more powerful kdiff3. Yes that 'k' you see in the front indecates a KDE program, but it is in pure qt (no KDE dependancies) and there is a really nice DMG based OS X package. And it is really powerful!

Git's mergetool had the option to use KDiff3, but of course if your KDiff3 is installed in /Applications/kdiff3.app/Content/MacOS/kdiff3, Git doesn't know where to find it. There are two possible solutions to this. The first is to add kdiff3 to your path. The second is to explicitly tell Git where to find it. I executed the following:

git config --global mergetool.kdiff3.path /Applications/kdiff3.app/Contents/MacOS/kdiff3
git config --global mergetool.tool kdiff3

Which globally (for all git projects on my user) sets the path to KDiff3 and then sets KDiff3 to the default for the mergetool command. There is one other little quirk needed to make either the path based method or this method work. Open KDiff 3 and make the following change:

Click: KDiff3 -> Preferences -> Integration

Add: "; --"

Save the setting and exit kdiff3

Comments

Leave a response

  1. John BachirJul 03 08 @ 08:36PM
    Thanks for posting this.
Comment