When the new OS version is ready to install a lot of developers are asking a question: Is everything will work after upgrade right after the release date? But not OS X users.

Unfortunately after upgrade to El Capitan 10.11 (from Yosemite) my command line git stopped work. I got such message:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
 !    Git appears to be installed incorrectly
 !    Ensure that `git --version` outputs the version correctly.

It’s not a big deal because at every-day work I’m using the best git client ever: SourceTree. But command line git is also used by other apps such as Heroku Toolbelt, so I had to fix the issue.

Fix is simple like Setup Java project with Gradle and looks like this:

xcode-select --install

xcode-select manages the active developer directory for Xcode and BSD tools.

Above command opens a user interface dialog to request automatic installation of the command line developer tools.

To check which developer directory is currently selected you can do this via:

xcode-select --print-path
Advertisements