GIT致命:拒绝合并无关的历史 [英] GIT Fatal : refusing to merge unrelated histories

查看:1015
本文介绍了GIT致命:拒绝合并无关的历史的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到:

  $ git pull origin master 
从https://bitbucket.org/tecgenome/ chl-v2.0-html
*分支大师 - > FETCH_HEAD
fatal:拒绝合并无关的历史

如何避免或避免错误消息?

解决方案

自从Git 2.9 (2016年4月),你可以尝试:

  git pull --allow-unrelated-history来源大师

但是请检查为什么这些分支不再常见,但是。

可能有一个强制推式重写全部 origin / master 的历史记录。

在这种情况下,如果您没有自己的本地提交,最好将您的分支重置为新的分支:

  git fetch 
git reset --hard origin / master


I see:

$ git pull origin master
From https://bitbucket.org/tecgenome/chl-v2.0-html
 * branch            master     -> FETCH_HEAD
fatal: refusing to merge unrelated histories

How can I avoid or get past that error message?

解决方案

Since Git 2.9 (April 2016), you can try:

git pull --allow-unrelated-histories origin master

But check why those branches are no longer common though.
May be there was a force push rewritting all the history of origin/master.

In which case, if you don't have local commits of your own, it is best to reset your branch to the new one:

git fetch
git reset --hard origin/master

这篇关于GIT致命:拒绝合并无关的历史的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆