How to use opendiff as default mergetool

git, mergetool, opendiff

Solution

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

Problem

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 :(

Original source