I’ve got the following error when I want to use git:
moore@macbook ~ % git --version
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
I’ve upgraded my MacBook Pro to macOS Monterey 12.3.1 two days ago:
moore@macbook ~ % sw_vers
ProductName: macOS
ProductVersion: 12.3.1
BuildVersion: 21E258
You have to agree to the window:
The "xcode-select" command requires the command line developer tools. Would you like to install the tools now?
The Install Command Line Developer Tools
is running:
You have to agree the Licence agreement
:
You will have one first set of Download of the software:
You will have a second step of installation:
Depending on the speed of your connection, you can count on 15 to 30 minutes of installation.
Installation completed with the message The software was installed
:
Problem solved, git is working again:
moore@macbook ~ % git --version
git version 2.30.1 (Apple Git-130)