新建了一個倉庫以後,把本地倉庫進行關聯提交、拉取的時候,出現了以下錯誤:git
ankobot@DESKTOP-9IUDMKP MINGW64 /e/workspace/firmware_upload/firmware_upload (master) $ git pull fatal: refusing to merge unrelated histories
在你操做命令後面加 --allow-unrelated-histories
例如:ide
git merge master --allow-unrelated-histories
$ git pull --allow-unrelated-histories CONFLICT (add/add): Merge conflict in .gitignore Auto-merging .gitignore Automatic merge failed; fix conflicts and then commit the result.
我這裏因爲使用了官方的 .gitignore 自動合併失敗,須要手動合併以後再進行 add、commit 便可spa
若是你是git pull或者git push報fatal: refusing to merge unrelated histories
同理:
git pull origin master --allow-unrelated-histories / git pull --allow-unrelated-histories
等等,就是這樣完美的解決!code