Xcode took over my git installation, what happened?

Viewed 656

I've been using git on my MacBook pro for years and have also had xcode installed but rarely if ever used it. Yesterday I accidentally opened xcode and immediately closed it. Then, git commands in my docker environment stopped working (git failed to detect that the directory was a git repo), so I went back to my regular environment and type git status, and saw the below message

You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.

Press the 'return' key to view the license agreements at '/Applications/Xcode.app/Contents/Resources/en.lproj/License.rtf'

If I run which git the output is /usr/bin/git - is this perhaps a version of git installed by xcode? What happened? How can I get my original git installation back? Thanks

2 Answers

I was having the same problem after yesterday's update to Xcode. Running the following command in the Terminal fixed the problem.

sudo xcode-select -switch /Library/Developer/CommandLineTools

Source: https://developer.apple.com/forums/thread/666584

I am an R/RStudio user and today I found the Git tab missing. I noticed xcode related message in Console, and install XCode commandline tools and git several times but still Git tab was missing.

In the end, I've come here and finally fixed the problem. Thank you!

Related