Git is not working after macOS Mojave Update (xcru

2019-01-16 03:00发布

Last night i updated to macOS Mojave,

This morning I navigated to my work's code base 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

8条回答
何必那么认真
2楼-- · 2019-01-16 03:23

I figured out the Xcode Command Line Tools part from the error message, but after running Xcode and getting the prompt to install the additional tools it did claim to install them, but still I got the same error after opening a new terminal.

So I did the xcode-select --install manually and after that it worked for me.

查看更多
孤傲高冷的网名
3楼-- · 2019-01-16 03:25

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

Go back to your terminal and hit:

xcode-select --install

You'll then receive:

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

And be prompted in 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.

查看更多
Summer. ? 凉城
4楼-- · 2019-01-16 03:26

For me xcode-select --reset was the solution on Mojave.

查看更多
孤傲高冷的网名
5楼-- · 2019-01-16 03:30

I got some errors that the software was unavailable from the update server when trying

xcode-select --install

What fixed it for me was going here https://developer.apple.com/download/more/ and downloading Command Line Tools (macOS 10.14) for Xcode 10 and then installing it manually.

After that, the errors should be gone when you open up a new terminal.

查看更多
Evening l夕情丶
6楼-- · 2019-01-16 03:32

For me what worked is

sudo xcode-select --reset

as is on @High6's answer above, then

sudo sudo xcodebuild -license

this will reveal a licence which I assume is some xcode licence, scroll to the bottom using space button then type agree.

This is what worked for me on MacOS Mojave v 10.14

查看更多
倾城 Initia
7楼-- · 2019-01-16 03:34

For me, I didn't have xcode installed (on Mojave OS). I went to the App Store on my mac and downloaded it, then went back to terminal and typed git and hit enter, then it worked.

查看更多
登录 后发表回答