一、fatal: refusing to merge unrelated histories
新建了一个本地仓库之后,把本地仓库和远程仓库进行关联提交、拉取的时候,
出现了如下错误:
$ git pull origin master
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 9 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (9/9), 786 bytes | 34.00 KiB/s, done.
From gitee.com:llliyuheng/1111
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master
fatal: refusing to merge unrelated histories
二、解决方案
在你的操作命令后面加 --allow-unrelated-histories
例如:
$ git merge master --allow-unrelated-histories
如果你是git pull或者git push报fatal: refusing to merge unrelated histories
同理:
git pull origin master --allow-unrelated-histories / git pull --allow-unrelated-histories
等等,就是这样完美的解决pofei!文章来源:https://www.toymoban.com/news/detail-735918.html
--文章来源地址https://www.toymoban.com/news/detail-735918.html
到了这里,关于Git解决 fatal: refusing to merge unrelated histories的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!