After upgrade to Big Sur git stopped working

After upgrade to Big Sur git stopped working and it keeps prompting to install CLT. According to Xcode-select, see output below CLT is already installed:

sbezverk@sbezverk-mac-2 ~ % sudo xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

sbezverk@sbezverk-mac-2 ~ % git

sh: line 1:   772 Bus error: 10           /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk macosx -find git 2> /dev/null

git: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk macosx -find git 2> /dev/null' failed with exit code 35328: (null) (errno=No such file or directory)

xcode-select: Failed to locate 'git', requesting installation of command line developer tools.

Any help to solve this issue would be great.
Post marked as unsolved Up vote post of sbezverk Down vote post of sbezverk
122 views

5 Replies

Thanks @mcingi and I think I think it is better to up vote the correct answer as this makes it easy for other people to find.
For those experiencing problem after running

$ sudo xcode-select -switch /Library/Developer/CommandLineTools

Try downloading the Xcode command line tools from -> Apple Developers Command line tools and repeat the xcode-select command above. All the best !

Same here. However, got another error when run the xcode-select

Code Block
MBP$ sudo xcode-select -switch /Library/Developer/CommandLineTools
xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools'


Do I need to reinstall the xcode after upgrade to Big Sur?


Thanks mclngl !
Thanks! I had the same problem and it solved the problem.
I was having the same issue.
I managed to get it fixed by running

sudo xcode-select -switch /Library/Developer/CommandLineTools