Git not working after macOS update: invalid active developer path
So you recently updated to the latest macOS and ran a git status
only to be greeted with:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
What happened? Did the update completely mess up your Git installation?
Worry not, the fix is very simple; you just need to update the Xcode Command-line Tools. So run this:
$ xcode-select --install
You will then be greeted with this prompt:
Click "Install" and agree to the "Commandline Tools License Agreement" in the following window. The update is about 130 MB, wait for it to complete.
Once done, git
will continue to work as usual.
If the above steps didn't solve your problem, run this additional command:
$ xcode-select --reset
git
path, but git
itself not working.The solution described earlier will fix the problem in VSC too.
Summary#
macOS updates do not update the Xcode Command-line Tools by default. Unless it is updated many command-line tools like git
will fail to work. It can be updated using xcode-select --install
.