1.? git pull 失敗提示: fatal: refusing to merge unrelated histories 錯誤
錯誤場景: 本地創(chuàng)建一個aaa的git倉庫,在其git倉庫中放了一些文件,并關(guān)聯(lián)了github上的遠(yuǎn)程aaa倉庫(已初始化,產(chǎn)生了Readme.md 文件);現(xiàn)在從遠(yuǎn)程端pull數(shù)據(jù)到本地報下面的錯了。

報錯內(nèi)容說明:?兩個根本不相干的 git 庫, 一個是本地庫, 一個是遠(yuǎn)端庫, 然后本地要去推送到遠(yuǎn)端, 遠(yuǎn)端覺得這個本地庫跟自己不相干, 所以告知無法合并。
解決方案:git pull origin master --allow-unrelated-histories? ? # 后面加上?--allow-unrelated-histories?, 把兩段不相干的分支進(jìn)行強(qiáng)行合并