Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode command line tools not able to locate git

On Big Sur, I had XCode CLT installed, but not xcode itself. Git was working fine. Then I installed XCode and now when I try to run git I get the following message:

git: error: Failed to determine realpath of '/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk' (errno=No such file or directory)
git: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -find git 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory)
xcode-select: Failed to locate 'git', requesting installation of command line developer tools.

A popup comes up, asks to install CLT and when I say ok, it downloads and installs for a few minutes. But when it's done, I'm right back where I started.
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk does not exist, but there are directories for 10.15, 11.1 and 11.3. But not 10.14.

like image 673
Kardasis Avatar asked Jan 19 '26 19:01

Kardasis


2 Answers

Run the command:

sudo xcode-select -switch /Library/Developer/CommandLineTools
like image 140
Sami Ullah Avatar answered Jan 22 '26 09:01

Sami Ullah


I had the same experience. The solution was to launch Xcode and complete that first run. It downloaded some stuff as part of the process and git was fine after that.

I was receiving the same block of error messages you were, but in either the line above or below was a tidbit suggesting to run xcodebuild -runFirstLaunch which I suspect would have had the same effect as manually running Xcode that first time.

like image 31
jaydisc Avatar answered Jan 22 '26 09:01

jaydisc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!