Git xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcru

Question one

After upgrading the latest MacOS system, GIT, which had no problem, reported the following error:

Сannot Run Git
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

At this time, thanks to Baidu, I found a solution

resolvent

The solution to the above problem is to execute the command on the terminal

xcode-select --install

After the installation is successful, we can execute git command on the terminal. The magic thing happened. Git command can run normally

Question 2

Next, let’s talk about another magical problem. If you are using the idea editor, when you open the idea, you may find that the idea will always prompt the following error message:

Cannot Run Git
xcrun:error:invalid active developer path...

The screenshot is as follows:

at a loss, we found a solution again

Solution

Click the preferences option in the system to enter the system configuration page, search git in the search box of the system configuration page, and configure the path to git executable option in the GIT configuration page as git, as shown in the following figure:
, and then click apply Submit the configuration information just now. Next, close the configuration page. It’s time to witness the miracle. The error message disappears. In this way, the configuration of GIT error message in the whole system is completed


Read More: