Git is not working after macOS update (“xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools”)

The problem is that Xcode Command-line Tools needs to be updated due to OS update.

** UPDATED for Ventura and updated apple dev download page **

After opening the terminal after a restart, I tried to go to my code, and do a git status, and I got an error and prompt for command line software agreement.

So press space until you get to the [agree, print, cancel] option, so careful hit space to scroll down to the end, if you blow past It you have to run a command to get it back. Use sudo xcodebuild -license to get to it again.

Just be careful on scrolling down and enter agree and press return and it will launch into an update.

Xcode software license

Then I tried to use git after the install, and it prompted me to install Xcode tools again.

I followed my own advice from previous years (see below ), and went to https://developer.apple.com/download/all and downloaded
“Command Line Tools for Xcode 14” (You have to log in with your Apple ID and enter MFA code, so have all the devices you need for that handy. Then select “Command Line Tools for Xcode 14”, or if you want to get into the alphas or betas, that’s up to you. But stable releases are probably the best choice.

developer download page selection for "Command Line Tools for Xcode 14"

You have to either download the tools from CLI or the developer page and before you can use git, you need to reboot!!! SUPER IMPORTANT, you can get stuck in a loop of downloading

Rebooting will break the loop and complete the installation of your CLI tools including git so that you can get back to work

Solutions for previous years, these may or may not be valid these days as the downloads page has changed significantly:

PREVIOUS YEARS SOLUTIONS, probably #2 is most helpful.

*** Solution #1:

Go back to your terminal and enter:

xcode-select --install

You’ll then receive the following output:

xcode-select: note: install requested for command line developer tools

You will then be prompted in a window to update Xcode Command Line tools. (which may take a while)

Open a new terminal window and your development tools should be returned.

Addition: With any major or semi-major update you’ll need to update the command line tools in order to get them functioning properly again. Check Xcode with any update. This goes beyond Mojave…

After that restart your terminal

Alternatively, IF that fails, and it very well might…. you’ll get a pop-up box saying “Software not found on server”, see below!

*** Solution #2: (Preferred method)

If you hit xcode-select --install and it doesn’t find the software, log into Apple Developer, and install it via webpage.

Log in or sign up here:

https://developer.apple.com/download/more/

Look for: “Command Line Tools for Xcode 14.x” in the list of downloads
Then click the dmg and download.

Apple Developer page to find "Command Line Tools for Xcode 14"

Leave a Comment