Xcode – Invalid active developer path error after upgrading to El Capitan


I ran into this error trying to push to git, when I typed git init.

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

I tried the following solutions.

xcode-select —install
sudo xcode-select -switch
sudo xcode-select —install
brew doctor
brew update
brew upgrade
brew cleanup

Best Solution

This is all you need to do:

$ xcode-select --install