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
CodePudding user response:
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