描述

在使用git pull origin master拉取github代码时,报以下错误:
fatal: refusing to merge unrelated histories

解决办法

git pull origin master换成git pull origin master --allow-unrelated-histories

本人之所以还有错误,是因为有冲突,解决后commit一下即可。

原因

以下说明来自Stack Overflow,英文不太行,有兴趣自己研究一下咯。
“git merge” used to allow merging two branches that have no common base by default, which led to a brand new history of an existing project created and then get pulled by an unsuspecting maintainer, which allowed an unnecessary parallel history merged into the existing project. The command has been taught not to allow this by default, with an escape hatch –allow-unrelated-histories option to be used in a rare event that merges histories of two projects that started their lives independently.

Git pull 错误:fatal: refusing to merge unrelated histories解决办法相关推荐

  1. git初始化错误fatal: refusing to merge unrelated histories

    发生原因: git服务上创建了git远程仓库,并且创建README.md文件 本地初始化项目 关联远程仓库:git remote add origin "远程仓库地址" 可以:gi ...

  2. git pull出现“fatal: refusing to merge unrelated histories“

    一.问题描述 从远程仓库拉取代码到本地仓库的时候提示: zz@DESKTOP-MR95PVJ MINGW64 /d/Tool/PythonProject/drfdemo (master) $ git ...

  3. Git出现 FETCH_HEAD fatal: refusing to merge unrelated histories解决方法

    目录 1. 问题所示 2. 解决方法 1. 问题所示 出现如下问题: PS D:\项目\manongyanjiuseng> git pull origin master From ssh://x ...

  4. 解决Git中的fatal: refusing to merge unrelated histories

    创建了一个全新的项目,在开发分支开发完成后,但是在进行Merge Request的时候出现如下问题: 要求我进行rebase,我想是因为远程项目的RELEASE(直接从master创建的分支,所有的代 ...

  5. git pull 提示错误 fatal: refusing to merge unrelated histories

    从远程拉项目到本地的时候提示错误 造成 fatal: refusing to merge unrelated histories错误的原因有以下几点: 有一个包含一些提交的新 Git 存储库.然后,您 ...

  6. git pull代码出现refusing to merge unrelated histories错误

    本地推送代码到远程出现refusing to merge unrelated histories 本地仓库在想做同步远程仓库到本地为之后本地仓库推送到远程仓库做准备时报错了,错误如下: fatal: ...

  7. 解决Git报错: fatal: refusing to merge unrelated histories

    如果合并了两个不同的开始提交的仓库,在新的 git 会发现这两个仓库可能不是同一个,为了防止开发者上传错误,于是就给下面的提示 git无法pull仓库refusing to merge unrelat ...

  8. fatal: refusing to merge unrelated histories解决

    背景:由于公司进行了仓库迁移,同事直接把代码init推进了新的仓库地址,我想在本地代码上切换远程仓库地址进行拉取远端代码时出现报错"fatal: refusing to merge unre ...

  9. 解决Git中fatal: refusing to merge unrelated histories

    Git的报错 在使用Git的过程中有时会出现一些问题,那么在解决了每个问题的时候,都需要去总结记录下来,下次不再犯. 一.fatal: refusing to merge unrelated hist ...

最新文章

  1. /var/spool/clientmqueue文件分析
  2. Android游戏开发指南一背景地图
  3. 策略模式(stragegy)
  4. c8800 mp4设置
  5. 你可能会用到的 Mock 小技巧
  6. evt参数是干啥用的_塑料凳子上的洞,是干啥用的?
  7. 如何从javascript检索GET参数? [重复]
  8. Windows平台下搭建Git服务器的图文教程
  9. configure: error: Cannot find OpenSSL's libraries
  10. eclipse中文版eclipse汉化教程
  11. 记一次jenkins构建无权限问题
  12. SpringMVC+Vue实现前后端分离的宠物管理系统
  13. VEMD11940FX01光学传感器
  14. Matplotlib设置坐标轴日期格式
  15. python终端界面分屏输出_linux命令 - screen/终端分屏命令
  16. 激光雷达与组合惯导联合标定--方案二(matlab)
  17. 旭日x3派个人配置总结(ubuntu server + xrdp)
  18. C++内存管理与指针的使用
  19. java的单行注释符是_Java 程序中的单行注释符是( ),多行注释符是( )_学小易找答案...
  20. springboot服务器没响应,记一次springboot 故障:接口无响应--》CPU 100%---》log无法写入---》磁盘满了...

热门文章

  1. asp.net core 系列之webapi集成EFCore的简单操作教程
  2. HanLPTokenizer HanLP分词器
  3. MySql 扩展存储引擎
  4. 用Android NDK打造自己的toolchain(使用C/C++默认的Makefile)
  5. Cocos2d-x 3.2 EventDispatcher事件分发机制
  6. blog被封了文章全被删除了,郁闷
  7. CruiseControl中应用NCover和NCoverExplore
  8. SQL中Truncate的用法
  9. Ansible的Inventory管理
  10. 当我们在谈论技术时,技术的本质和价值究竟是什么?