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.

Same issue after installing Ventura. A "fix" isn't good enough for me: I want to know why it's happening and/or how I can try to prevent it in the future (seems to be a common problem w/ MacOS upgrades, based on internet searching; it's pathetic that Apple can't fix this!), e.g., should I "hide" a directory by prefixing it with a "." before installing updates and then unhide it afterward? There's got to be a way to prevent this from happening (even if Apple won't figure it out).

After upgrade to Big Sur git stopped working
 
 
Q