xcrun: error: invalid active developer path
Mac is a nice computer for developing, MacOS and Apple can make your developer life a challange. After updating XCode – after all, why have a Mac when you do not develop iOS apps – it may happen that git stops working.
Running git gives you:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Usual situation: it worked yesterday, today it is broken and you did nothing. Besides updating XCode. The problem occurs easily. When you update XCode, normally you also update the command line tools.
In case the Apple App Store isn’t giving you the option to update the command line tools, run the command
xcode-select: note: install requested for command line developer tools
This should either install the command line tools and give you back a working git tool, or let you install the tools manually via the App Store.
After this, git should be working again. Happy coding.