2

【踩坑】Git执行pull命令时报错

 1 year ago
source link: https://loli.fj.cn/2023/03/30/Git%E6%89%A7%E8%A1%8Cpull%E5%91%BD%E4%BB%A4%E6%97%B6%E6%8A%A5%E9%94%99/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

【踩坑】Git执行pull命令时报错

2023-03-30

Git执行pull命令时报错:fatal: refusing to merge unrelated histories

  • 当前绑定的远端仓库与需要pull的远端仓库无关联

可能是因为当前仓库不是从clone得到的,而是通过init创建的,导致当前绑定的远端仓库与需要pull的远端仓库无关联

  • 重新clone项目,将源代码迁移到clone的项目中
  • 通过--allow-unrelated-historie参数把两段不相干的分支进行强行合并
git pull origin master --allow-unrelated-historie

腾讯云——小菠萝测试笔记


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK