跳至主要內容

Refusing to merge unrelated histories

Tom Tan小于 1 分钟使用指南页面配置使用指南

问题表现

有时候我们在pull代码的时候, 会出现这个错误. 有可能本地和服务器上面的分支没有关系上。

fatal: refusing to merge unrelated histories

解决方案

其实在命令的加上以下这个参数, --allow-unrelated-histories 就可以了

例如我的命令是

git pull origin master --allow-unrelated-histories

希望对你有帮助。

上次编辑于:
贡献者: Tom Tan