If you are getting the following error:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
you probably have updated to Mojave. The fix is really simple and quick.
Run this command in terminal.
> xcode-select --install
Then test with git –version and all should be well.