OS X El Capitan/macOS Sierra/macOS High Sierra
 I just upgraded from Yosemite to El Capitan (and replicated the problem upgrading from El Capitan to Sierra), and when I try to type for example git status inside a terminal, I get the following error:  
xcrun: error: invalid active developer path
 (/Library/Developer/CommandLineTools), missing xcrun at:
 /Library/Developer/CommandLineTools/usr/bin/xcrun
I don't have Xcode installed, never did. Anyone have a solution?
Found the fix for the problem here.
xcode-select --install
This will bring up a prompt to install the necessary command line tools.
 If you have issues with the xcode-select --install command;  eg I kept getting a network problem timeout, then try downloading the dmg at developer.apple.com/downloads (Command line tools OS X 10.11) for Xcode 7.1  
我尝试了解决方案xcode-select --install但它不帮助我,我从塞拉利昂更新到高发生这种情况,我的解决方案: 
sudo xcode-select --reset
上一篇: 无法将客户端证书发送到iOS应用程序
