多年來,我一直在我的 MacBook Pro 上使用 git,并且還安裝了 xcode,但很少使用它。昨天不小心打開了xcode,立馬關閉了。然后,我的 docker 環境中的 git 命令停止作業(git 未能檢測到該目錄是 git repo),所以我回到常規環境并輸入 git status,并看到以下訊息
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'
如果我運行which git輸出是/usr/bin/git- 這可能是 xcode 安裝的 git 版本嗎?發生了什么?我怎樣才能恢復我原來的 git 安裝?謝謝
uj5u.com熱心網友回復:
昨天更新到 Xcode 后,我遇到了同樣的問題。在終端中運行以下命令解決了這個問題。
sudo xcode-select -switch /Library/Developer/CommandLineTools
來源:https ://developer.apple.com/forums/thread/666584
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/507437.html
