graphical diff for git on mac os x

I just configured git to use FileMerge for diffs. FileMerge is a pretty graphical diff tool. I couldn't find quite the right invocation via google, so here's what I did:


  1. Create ~/bin/git-diff-driver.sh with these contents:
    #!/bin/sh
    /usr/bin/opendiff "$2" "$5"

  2. Make it executable
    chmod ugo+x ~/bin/git-diff-driver.sh


  3. Make git use this little script for diffs. Edit ~/.gitconfig to include these lines:
    [diff] 
    external = "/Users/ben/bin/git-diff-driver.sh"


Now the next time that you call git diff HEAD FileMerge will open. GUI sweetness.