問題
- 克隆代碼的時候警告內(nèi)容
warning: templates not found in /usr/local/git/share/git-core/templates
弊决,導致的失敗队伟。
修復方法如下:
在終端輸入:sudo chmod -R 755 /usr/local/git/share/git-core/templates
如果文件夾不存在:sudo mkdir -p /usr/local/git/share/git-core/templates
錯誤:fatal: refusing to merge unrelated histories
原因:兩個分支是兩個不同的版本惦积,具有不同的提交歷史
解決:git pull origin master --allow-unrelated-histories
可以允許不相關(guān)歷史提,強制合并。查找是否安裝了git
git --version
which git
查看git所在路徑解決每次操作都讓輸入密碼
方案1:SourceTree -> 偏好設置-> Git -> 使用系統(tǒng)安裝的Git ->打開->輸入電腦登錄密碼->點擊始終按鈕
方案2:git config --global credential.helper osxkeychain
參考git pull時報錯
error: You have not concluded your merge (MERGE_HEAD exists).
hint: Please, commit your changes before merging.
fatal: Exiting because of unfinished merge.
解決辦法:保留本地的更改,中止合并 -> 重新合并 -> 重新拉取
git merge --abort # 保留本地的更改,中止合并
git reset --merge # 重新合并
git pull