After upgrading to macOS Mojave, I tried to run GIT from Terminal but it kept giving me the following error:
xcrun: error: invalid active developer path (
This line worked for me. I had the same issue. Run it in the terminal.
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer