Question: 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?

Answer: 
In macOS 10.14 this issue may also occur if you have two or more versions installed. If you like xCode GUI you can do it by going into preferences - `CMD + ,`, selecting `Locations` tab and choosing version of Command Line Tools. Please refer to the attached print screen.

[![enter image description here](https://i.stack.imgur.com/j1nxw.png)](https://i.stack.imgur.com/j1nxw.png)
Updated to High Sierra 10.13.2 

**xcode-select --install** ALONE did not work for me.

1. Download X-code from app store
2. $xcode-select --install  

a. May need to update after install using *softwareupdate* in command line. $sudo softwareupdate -i "Command Line Tools (macOS High Sierra version 10.13) for Xcode-9.1"
3. $sudo xcodebuild -license