当前位置:   article > 正文

Git解决 fatal: refusing to merge unrelated histories_* branch master -> fetch_head fatal: refusing to m

* branch master -> fetch_head fatal: refusing to merge unrelated histories

一、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!

--

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/505821
推荐阅读
相关标签
  

闽ICP备14008679号