Fixing Git on MacOS X Sierra

If, like me you have upgraded to the Mac OS X Sierra beta you may find that Git is broken from the command line. The error I was seeing was:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

It turns out that the developer tools are borked on upgrade so need reinstalling. To do that you need to run:

xcode-select --install

After a short download and installation everything should be back to normal.