Git报错-refusing to merge unrelated histories

Posted init-007

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Git报错-refusing to merge unrelated histories相关的知识,希望对你有一定的参考价值。

执行git pull 时报错:

出现这个问题的最主要原因还是在于本地仓库和远程仓库实际上是独立的两个仓库。假如我之前是直接clone的方式在本地建立起远程github仓库的克隆本地仓库就不会有这问题了。

可以在pull命令后紧接着使用--allow-unrelated-history选项来解决问题(该选项可以合并两个独立启动仓库的历史)。

命令:

$git pull origin master –allow-unrelated-histories

以上是将远程仓库的文件拉取到本地仓库了。

以上是关于Git报错-refusing to merge unrelated histories的主要内容,如果未能解决你的问题,请参考以下文章

Git 报错:fatal: refusing to merge unrelated histories

Git merge 出现 refusing to merge unrelated histories

GIt -- fatal: refusing to merge unrelated histories 问题处理

问题解决方案git无法pull仓库refusing to merge unrelated histories

Git:fatal: refusing to merge unrelated histories

git fatal: refusing to merge unrelated histories