How to use opendiff as default mergetool

CorpusCallosum picture CorpusCallosum · Dec 5, 2012 · Viewed 27.9k times · Source

Hi I am trying to use opendiff as the git mergetool, but when I run mergetool I get this error message:

The merge tool opendiff is not available as 'opendiff'

What am I doing wrong? It was working fine before, but since I installed a new harddrive it's not working anymore :(

Answer

Kevin Leary picture Kevin Leary · Sep 2, 2014

You'll need to configure opendiff as your global merge.tool:

# locate xcode utilities
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

# set "opendiff" as the default mergetool globally
git config --global merge.tool opendiff

If you get Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo, opening XCode and accepting the license fixes the issue