当前位置:   article > 正文

git fatal: refusing to merge unrelated histories

git fatal: refusing to merge unrelated histories

今天在拉取远程仓库上的项目时出现了这个个问题

C:\Users\Administrator\Source\Repos\NewRepo>git pull https://github.com/houchuanhao/ACM.git master
From https://github.com/houchuanhao/ACM
  • 1
  • 2
  • 3

错误提示如下

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

原因是在本地的文件夹为NewRepo,与远程仓库名称不一样

解决方案:

pull时添加 –allow-unrelated-histories

C:\Users\Administrator\Source\Repos\NewRepo>git pull origin master --allow-unrelated-histories
From github.com:houchuanhao/ACM
 * branch            master     -> FETCH_HEAD
Merge made by the 'recursive' strategy.
 README.md | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 README.md
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/592851
推荐阅读
相关标签
  

闽ICP备14008679号