git 切换远程库后无法pull问题(fatal: refusing to merge unrelated histories)

切换了一个远程库,先从删除现在的远程库

>git remote rm origin

>git remote add origin git@code.aliyun.com:xxx/xxx.git

>git pull origin master
From code.aliyun.com:xxxx/xxx

  • branch master -> FETCH_HEAD
    fatal: refusing to merge unrelated histories

>git pull origin master –allow-unrelated-histories

>git push -u origin master

添加 --allow-unrelated-histories 告诉 git 允许不相关历史合并

参考:https://blog.csdn.net/lindexi_gd/article/details/52554159

命令参考:https://www.yiibai.com/git

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注