xcrun: error: invalid active developer path
使用終端克隆github的代碼到本地時(shí)報(bào)錯(cuò)
報(bào)錯(cuò)信息
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
解決辦法
sudo xcode-select --reset
fatal: refusing to merge unrelated histories
推到倉(cāng)庫(kù)時(shí)報(bào)錯(cuò),字面意思是拒絕合并不相關(guān)的歷史
報(bào)錯(cuò)信息
fatal: refusing to merge unrelated histories
解決辦法
原因是兩個(gè)分支是兩個(gè)不同的版本,具有不同的提交歷史,可以添加參數(shù)--allow-unrelated-histories(git 2.9.2,允許合并兩個(gè)記錄的倉(cāng)庫(kù))解決

官方解釋.png
// 拉取遠(yuǎn)程倉(cāng)庫(kù)的文件到本地(允許獨(dú)立記錄)
git pull origin master --allow-unrelated-histories
// 以下兩者任選其一
//// 建立本地分支與上游的關(guān)系
// git push --set-upstream origin master
// 推送本地倉(cāng)庫(kù)的提交到遠(yuǎn)程倉(cāng)庫(kù)
// git push <遠(yuǎn)程主機(jī)名> <本地分支名>:<遠(yuǎn)程分支名>
git push origin master:master