After upgrading to macOS Mojave, I tried running GIT from Terminal or IDE but it kept giving the following error:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun.
The problem is that you are using XCode and you explicit have to agree to the license agreement. So open Terminal, and run the following:
This will download and install xcode developer tools and fix the problem. As a follow on step, you may need to reset the path to Xcode if you have several versions or want the command line tools to run without Xcode
xcode-select --switch /Applications/Xcode.app xcode-select --switch /Library/Developer/CommandLineTools