I've had git
running on my MacBook Pro (macOS High Sierra 10.13.6) for ages. I recently uninstalled Xcode because I never use it, but that seems to have broken Git and I can't figure out how to fix it.
If I open a terminal window and type git --version
, I get the following error:
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.
If I then try Xcode-select --install, I get:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Software Update shows no updates are available. I tried to reinstall Xcode from the App Store, but I'm getting:
Xcode can’t be installed on “Macintosh HD” because macOS version 10.14.3 or later is required.
I can't upgrade my macOS version because it says no updates are available!
I tried installing git from the downloadable package, but that made no difference (it seemed to install ok, but I don't know where it installed and it's still looking for the old version). Then tried Homebrew, which again seemed to work but made no difference, so I uninstalled it.
I don't know what to try next! I don't really know what I'm doing with macOS and I'm a bit concerned I'll break stuff if I fiddle too much. Can anyone help?
type -a git
andecho $PATH
shows you?xcode-select --reset
.