Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use opendiff as default mergetool

Tags:

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

like image 864
CorpusCallosum Avatar asked Dec 05 '12 08:12

CorpusCallosum


2 Answers

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

like image 50
Kevin Leary Avatar answered Oct 15 '22 00:10

Kevin Leary


Make sure you have XCode installed. (If you are using git then you probably using brew, in that case you probably already have XCode installed.)

A one-off solution is to tell git what tool you want to use:

$ git mergetool -t opendiff 

As far as setting up opendiff as your default tool, you need to set the "merge.tool" variable in your git config file.

like image 31
cogell Avatar answered Oct 15 '22 01:10

cogell