+10 votes
1 view
in Devops and Agile by (28.1k points)
edited by

Last night I updated to macOS Mojave,

This morning I navigated to my work's codebase in Command line on my MacBook Pro,

typed in "git status" in the repo and received the error:

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

1 Answer

+10 votes
by (48k points)
edited by

This problem occurs due to Xcode command-line tools are not updated.

For updating Xcode command-line tools

Goto terminal and use the following command:

xcode-select --install

Then it shows 

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

And opens a window to update Xcode command-line tools.

After the update is completed, open a new terminal window and your development tools should be returned.

After the update you need to restart your terminal to apply the updates then the function works properly.

Reference:https://developer.apple.com/library/archive/technotes/tn2339/_index.html

For more information regarding git commands, like git status, git clone, git merge, etc. please go through this tutorial.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...