问题描述:

Git报错 git pull时报错:fatal: refusing to merge unrelated histories

原因分析:
  • fatal: refusing to merge unrelated histories
    (拒绝合并不相关的历史)
  • 出现这个问题的最主要原因还是在于本地仓库和远程仓库实际上是独立的两个仓库。假如我之前是直接clone的方式在本地建立起远程github仓库的克隆本地仓库就不会有这问题了。
解决方案
  • 可以在pull命令后紧接着使用–allow-unrelated-history选项来解决问题(该选项可以合并两个独立启动仓库的历史)。
    -git pull origin master --allow-unrelated-histories

相关文章:

  • 2021-06-24
  • 2022-12-23
  • 2021-11-29
  • 2021-08-12
  • 2022-12-23
  • 2021-10-13
猜你喜欢
  • 2021-08-11
  • 2022-12-23
  • 2021-08-29
  • 2022-12-23
  • 2022-12-23
  • 2021-04-16
  • 2021-10-22
相关资源
相似解决方案