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 :(
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:
As far as setting up opendiff as your default tool, you need to set the "merge.tool" variable in your git config file.
git supports --dir-diff (-d) to perform a directory diff, which looks good in FileMerge. However, there are a couple of minor problems using opendiff with --dir-diff. opendiff doesn't have a --merge target preset, and git will drop the temp files too soon to save changes. My work-around is to use a little bash script to invoke FileMerge. I called it
gdiff
.https://gist.github.com/miner/e73fc98a83a8fe05d9ef000d46d68a9f
Call it like this:
git difftool -d -x gdiff
You'll need to configure opendiff as your global merge.tool:
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