title: How to use opendiff and git diff and not needing to install the whole Xcode app?
body: <p>After upgrading to MacOS Mojave, my <code>git</code> and <code>opendiff</code> stopped working (my <code>opendiff</code> is usually invoked by <code>git diff</code>).</p>
  
  <p>I was <a href="https://stackoverflow.com/questions/52522565/git-is-not-working-after-macos-update-xcrun-error-invalid-active-developer-pa">able to get <code>git</code> working, by using the following two lines</a>:</p>
  
  <pre><code>xcode-select --install
  sudo xcode-select -switch /Library/Developer/CommandLineTools
  </code></pre>
  
  <p>but <code>opendiff</code> and <code>git diff</code> still doesn't work. It seems one solution is to install the Xcode app, which is huge (said to be taking up 10GB on the hard drive). I checked Spotlight and typed FileMerge, and was able to find it, which should be the same as <code>opendiff</code>, and was able to use <code>ps ax</code> to find the path <code>/Applications/Xcode.app/Contents/Applications/FileMerge.app/Contents/MacOS/FileMerge</code>.  But then, using <code>git diff</code>, I actually used a bash script to invoke</p>
  
  <pre><code>#!/bin/sh 
  /usr/bin/opendiff "$2" "$5" -merge "$1" | cat
  </code></pre>
  
  <p>(see this <a href="https://gist.github.com/bkeating/329690" rel="nofollow noreferrer">github article about how to set up <code>git-diff-cmd.sh</code></a>)</p>
  
  <p>so I changed that second line to:</p>
  
  <pre><code>/Applications/Xcode.app/Contents/Applications/FileMerge.app/Contents/MacOS/FileMerge "$2" "$5" -merge "$1" | cat
  </code></pre>
  
  <p>but it doesn't work.  So FileMerge exists, and it looks like <code>opendiff</code> is FileMerge.  Can <code>git diff</code> be made to work without needing to install the whole Xcode app?</p>