Reason:

The reason is because I created repo in Github with initiated README.md file, and I tried to push a whole different project in to it.

"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.

Solution:


add options behind

git push origin master --allow-unrelated-histories

git使用笔记(四)错误报告 Git push rejected error: fatal: refusing to merge unrelated histories的更多相关文章

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

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

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

    原文链接: https://blog.csdn.net/wd2014610/article/details/80854807 Git的报错 在使用Git的过程中有时会出现一些问题,那么在解决了每个问题 ...

  3. Git 如何解决部署远程仓库出现 fatal: refusing to merge unrelated histories 问题

    想把本地仓库的文件搬到Github,先将远程仓库和本地仓库关联起来: 先到Github上复制远程仓库的SSH地址: 运行 git remote add origin 你复制的地址 理论上—如果在创建 ...

  4. git pull fatal: refusing to merge unrelated histories

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

  5. 成功解决Git:fatal: refusing to merge unrelated histories

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

  6. Git:fatal: refusing to merge unrelated histories

    如何去解决fatal: refusing to merge unrelated histories 先pull,因为两个仓库不同,发现refusing to merge unrelated histo ...

  7. GIt -- fatal: refusing to merge unrelated histories 问题处理

    今晚碰到这个问题-- fatal: refusing to merge unrelated histories 想了一下,为什么就这样了? 因为我是先本地创建了仓库,并添加了文件,然后再到github ...

  8. git pull 拉取报错:fatal: refusing to merge unrelated histories

    fatal: refusing to merge unrelated histories(拒绝合并不相关的历史) 使用 git pull origin master --allow-unrelated ...

  9. git pull 失败 ,提示:fatal: refusing to merge unrelated histories

    首次 git pull 时失败,并提示:fatal: refusing to merge unrelated histories 在使用git pull 命令时,添加一个可选项 git pull or ...

随机推荐

  1. 计蒜客 UCloud 的安全秘钥(随机化+Hash)

    题目链接 UCloud 的安全秘钥 对于简单的版本,我们直接枚举每个子序列,然后sort一下判断是否完全一样即可. #include <bits/stdc++.h> using names ...

  2. 前端笔记之Vue(七)Vue-router&axios&Vue插件&Mock.js&cookie|session&加密

    一.Vue-router(路由) 1.1路由创建 官网:https://router.vuejs.org/zh/ 用 Vue.js + Vue Router 创建单页应用,是非常简单的.使用 Vue. ...

  3. shell细节决定高度

    1.文件测试操作符 -f[file]:文件存在且为普通文件则为真; -d[directory]:文件存在且为目录文件则为真; -s[size]:文件存在且为文件大小不为0则为真; -e[exist]: ...

  4. Jenkins自动化部署入门(一)

    开始使用 Jenkins 这一段时间,技术总监为了减少测试环境每次提交新增接口都要部署项目的时间,搞了一个jenkins持续集成github.docker,这样只要每次push代码都会自动部署,确实节 ...

  5. php curl xml传输和转换

    <?php /** * API * User: sgfoot * Date: 2017/3/20 * Time: 18:05 */ class apiCurl { private $config ...

  6. Typora +google + Markdown Here 公众号

    一劳永逸的公众号排版方法  http://mp.weixin.qq.com/s/zb-YaacNLggG2-njF5HJ0A 

  7. 【postman】postman测试API报错如下:TypeError: Failed to execute 'fetch' on 'Window': Invalid value 对中文支持不好

    使用postman测试APi的时候,因为系统需要在header部带上登录用户的信息,所以 如下: 然后测试报错如下:TypeError: Failed to execute 'fetch' on 'W ...

  8. 调用tf.softmax_cross_entropy_with_logits函数出错解决

    原来这个函数,不能按以前的方式进行调用了,只能使用命名参数的方式来调用.原来是这样的: tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(y ...

  9. 【转载】Spark学习——入门

    要学习分布式以及数据分析.机器学习之类的,觉得可以通过一些实际的编码项目入手.最近Spark很火,也有不少招聘需要Spark,而且与传统的Hadoop相比,Spark貌似有一些优势.所以就以Spark ...

  10. Odoo 运费

    模块delievery可以将运费Charge给客户     安装delivery模块                 Delivery method     在做订单的时候,选择相应的运输方法, 系统 ...