‘git log’ failed with code 1:’xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
‘ error handling

(sourcetree, error handling, git log, commandLineTools, Xcode)

在更新Xcode後或清理xcode暫存資料時,git可能會出現下圖的錯誤訊息

‘git log’ failed with code 1:’xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

專案資料夾的git相關檔案都還存在,只是git無法顯示

可以參考本文進行排除

開啟終端機,重新安裝xcode-select

xcode-select --install

跳出視窗,按安裝

按同意

等待軟體下載完(實際上時間沒有這麼久XD)

安裝過程中,SourceTree會跳出要密碼的資訊
輸入電腦的密碼,並按“永遠允許”

Git就恢復可使用了

--

--