Typically when upgrading macOS to any major version, after the process is finished, we end up with broken git
command. This is what happened to me as soon as I performed an upgrade from macOS Monterey to macOS Ventura. The good news is that the remedy for this inconvenience is rather easy.
All you have to do is to pull Xcode Command Line Tools. This can be done without leaving terminal app. Follow this quick guideline to get your git
back on track.
Context
Described situation is depicted on the following screen.
$ git
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Solution
Let's pull Xcode Command Line Tools, with:
xcode-select --install
Installation will trigger the download process.
Once downloaded and installed (no interaction required), a confirmation will appear.
Type git
to see if everything works.
We are done.