git使用笔记(四)错误报告 Git push rejected error: fatal: refusing to merge unrelated histories
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的更多相关文章
- git 出现 fatal: refusing to merge unrelated histories 错误
git pull 失败 ,提示:fatal: refusing to merge unrelated histories 其实这个问题是因为 两个 根本不相干的 git 库, 一个是本地库, 一个是远 ...
- 解决Git中fatal: refusing to merge unrelated histories
原文链接: https://blog.csdn.net/wd2014610/article/details/80854807 Git的报错 在使用Git的过程中有时会出现一些问题,那么在解决了每个问题 ...
- Git 如何解决部署远程仓库出现 fatal: refusing to merge unrelated histories 问题
想把本地仓库的文件搬到Github,先将远程仓库和本地仓库关联起来: 先到Github上复制远程仓库的SSH地址: 运行 git remote add origin 你复制的地址 理论上—如果在创建 ...
- git pull fatal: refusing to merge unrelated histories
1.首先我github有个远程仓库,然后我本地有个仓库 本地仓库我新添加了一个文件,然后我去关联(git remote add origin git@github.com:qshilary/gitte ...
- 成功解决Git:fatal: refusing to merge unrelated histories
Get 报错 如果合并了两个不同的开始提交的仓库,在新的 git 会发现这两个仓库可能不是同一个,为了防止开发者上传错误,于是就给下面的提示 fatal: refusing to merge unre ...
- Git:fatal: refusing to merge unrelated histories
如何去解决fatal: refusing to merge unrelated histories 先pull,因为两个仓库不同,发现refusing to merge unrelated histo ...
- GIt -- fatal: refusing to merge unrelated histories 问题处理
今晚碰到这个问题-- fatal: refusing to merge unrelated histories 想了一下,为什么就这样了? 因为我是先本地创建了仓库,并添加了文件,然后再到github ...
- git pull 拉取报错:fatal: refusing to merge unrelated histories
fatal: refusing to merge unrelated histories(拒绝合并不相关的历史) 使用 git pull origin master --allow-unrelated ...
- git pull 失败 ,提示:fatal: refusing to merge unrelated histories
首次 git pull 时失败,并提示:fatal: refusing to merge unrelated histories 在使用git pull 命令时,添加一个可选项 git pull or ...
随机推荐
- BZOJ2002弹飞绵羊
动态树LCT模板题 #include<cstdio> #include<cctype> #include<algorithm> using namespace st ...
- Linux下Shell的快捷键(转)
下述所有命令在Linux/Unix的shell下有效,这里以bash为主.如有出入,以你自己的服务器为准.本文所指的Linux主要指RHEL/CentOS,Unix指的是FreeBSD,这也是Unix ...
- Maven设置代理
很多时候电信的网络对于出国不太稳定,针对一些库下载速度比较慢,所以在使用SSR出国时配置maven使用是一种不错的选择.当然,还有另一种选择,就是使用国内的镜像库. 操作步骤: 1.打开{M2_HOM ...
- composer配置和安装php框架
第一步:安装composerwin环境安装:下载地址:https://getcomposer.org/Composer-Setup.exe 下载后直接点击安装即可测试:cmd ->compose ...
- 利用NSString的Hash方法比较字符串
实际编程总会涉及到比较两个字符串的内容,一般会用 [string1 isEqualsToString:string2] 来比较两个字符串是否一致.对于字符串的isEqualsToString方法,需要 ...
- Java Unsafe类
参考了这篇文章:http://blog.csdn.net/aesop_wubo/article/details/7537278 <JAVA并发编程学习笔记之Unsafe类> Unsafe开 ...
- 【工作笔记】Git与Github经常使用使用方法
Git安装 http://www.liaoxuefeng.com/ Git配置用户信息: git config –global user.name "SCOTT" git conf ...
- 一个Netfilter nf_conntrack流表查找的优化-为conntrack添加一个per cpu cache
独悲须要忍受.快乐须要分享对Linux协议栈多次perf的结果,我无法忍受conntrack的性能,然而它的功能是如此强大,以至于我无法对其割舍,我想自己实现一个高速流表.可是我不得不抛弃依赖于con ...
- EasyUI datagrid border处理,加边框,去边框,都可以,easyuidatagrid
下面是EasyUI 官网上处理datagrid border的demo: 主要是这句: $('#dg').datagrid('getPanel').removeClass('lines-both li ...
- python(26)- 面向对象补充Ⅱ
一 isinstance(obj,cls)和issubclass(sub,super) isinstance(obj,cls)判断obj是否是类 cls 的对象 class Foo(object): ...