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

一、fatal: refusing to merge unrelated histories
今天在使用Git创建项目的时候,在两个分支合并的时候,出现了下面的这个错误。

~/SpringSpace/newframe on  master ⌚ 11:35:56
$ git merge origin/druid
fatal: refusing to merge unrelated histories
1
2
3
这里的问题的关键在于:fatal: refusing to merge unrelated histories
你可能会在git pull或者git push中都有可能会遇到,这是因为两个分支没有取得关系。那么怎么解决呢?

二、解决方案
在你操作命令后面加--allow-unrelated-histories
例如:
git merge master --allow-unrelated-histories

~/SpringSpace/newframe on  druid ⌚ 11:36:49
$ git merge master --allow-unrelated-histories
Auto-merging .gitignore
CONFLICT (add/add): Merge conflict in .gitignore
Automatic merge failed; fix conflicts and then commit the result.
1
2
3
4
5
如果你是git pull或者git push报fatal: refusing to merge unrelated histories
同理:
git pull origin master --allow-unrelated-histories
等等,就是这样完美的解决咯!
————————————————
版权声明:本文为CSDN博主「向小凯同学学习」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/wd2014610/article/details/80854807

解决Git中fatal: refusing to merge unrelated histories相关推荐

  1. 解决Git中fatal: refusing to merge unrelated histories(亲测)

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

  2. git pull fatal: refusing to merge unrelated histories

    1.首先我github有个远程仓库,然后我本地有个仓库 本地仓库我新添加了一个文件,然后我去关联(git remote add origin git@github.com:qshilary/gitte ...

  3. git 出现 fatal: refusing to merge unrelated histories 错误

    git pull 失败 ,提示:fatal: refusing to merge unrelated histories 其实这个问题是因为 两个 根本不相干的 git 库, 一个是本地库, 一个是远 ...

  4. Git - git 出现 fatal: refusing to merge unrelated histories 错误

    背景 git pull失败,提示:fatal: refusing to merge unrelated histories 根本原因 因为两个根本不相干的 git 库, 一个是本地库, 一个是远端库, ...

  5. 解决git: fatal:refusing to merge unrelated histories

    ** 解决Git中fatal: refusing to merge unrelated histories ** 前言 提示:这里可以添加本文要记录的大概内容: 在使用Git的过程中有时会出现一些问题 ...

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

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

  7. Git pull 错误:fatal: refusing to merge unrelated histories解决办法

    描述 在使用git pull origin master拉取github代码时,报以下错误: fatal: refusing to merge unrelated histories 解决办法 将gi ...

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

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

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

    一.fatal: refusing to merge unrelated histories 新建了一个本地仓库之后,把本地仓库和远程仓库进行关联提交.拉取的时候, 出现了如下错误: $ git pu ...

最新文章

  1. LeetCode简单题之两个数组的交集 II
  2. iis占用服务器内存,W3wp.exe 进程占用内存高消耗CPU近100%导致网站反应速度缓慢的解决方案...
  3. 关于数据访问模式(三)—— Data Accessor模式
  4. SAP Spartacus OccEndpointsService getUrl方法的实现原理
  5. php中files和FILRS,php获取文件内容最后一行示例
  6. 实现背景透明的方法,兼容ie6/7/8等浏览器
  7. python selenium list index out of range
  8. 针对不同pandas版本进行列名的修改
  9. tensorflow学习之常用函数总结:tensorflow.argmax()函数
  10. 浅谈面粉厂防爆的重要性及措施(转)
  11. 解决XCode运行app在模拟器上,提示模拟器不存在
  12. 【 2015-2016 XVI Open Cup, Grand Prix of Bashkortostan, SKB Kontur Cup Stage 2】题目总结
  13. 问题分析与解决——ADSL错误代码(转)
  14. 简单线性相关系数 r及检验
  15. SplitContainer的使用
  16. Could not resolve type alias 解决方法
  17. typora 自动添加标题序号
  18. 逆向-攻防世界-logmein
  19. 使用Echarts在前端页面绘制地图
  20. tinymce 实现 粘贴图片自动上传

热门文章

  1. JVM可创建的最大线程数
  2. Apache Superset从入门到放弃(基于python3.6.9)
  3. Yarn资源分配示例
  4. redis抽奖并发_Redis优化高并发下的秒杀性能
  5. .net函数查询_数据分析-SQL-复杂查询
  6. 怎么调整字段长短_木北造型:空气刘海卷发筒怎么用 木北造型告诉您
  7. 用python简单处理图片(2):图像通道\几何变换\裁剪
  8. Android AIDL使用介绍(1)基本使用
  9. HBase shell 中的十六进制数值表示
  10. Sublime Text 3添加右键