How to Fix Broken Git After Upgrading to macOS Ventura?

less than a minute of reading

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.

As soon as we trigger any git command this error is being thrown.
$ 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
After accepting the license agreement, this prompt will pop up.

Installation will trigger the download process.

Which takes several minutes as the size is rather vast.

Once downloaded and installed (no interaction required), a confirmation will appear.

We are done here.

Type git to see if everything works.

This indicates that the git command is available.

We are done.


Words: 193
Published in: Git · macOS