2019-11-29-git无法pull仓库refusing-to-merge-unrelated-histories
| title | author | date | CreateTime | categories |
|---|---|---|---|---|
|
git无法pull仓库refusing to merge unrelated histories
|
lindexi
|
2019-11-29 08:21:50 +0800
|
2018-2-13 17:23:3 +0800
|
git
|
本文讲的是把git在最新2.9.2,合并pull两个不同的项目,出现的问题
如何去解决 fatal: refusing to merge unrelated histories 合并两个不同历史的仓库
一开始是我在 Github 新建一个仓库,写了 License ,然后把本地一个写了很久仓库上传。
因为已经创建了和本地不同的,不是一个空仓库,在上传之前先pull,因为两个仓库不同,发现refusing to merge unrelated histories,无法 pull 所以上传失败,谷歌了很久才发现为何这样。
原来在 2.9.2 之后,不可以合并不同没有相同结点的分支,如果需要合并两个不同结点的分支,那么需要在git pull 添加一句代码--allow-unrelated-histories。于是修改之后的代码,假如源是origin,分支是master,那么请看下面代码。
git pull origin master --allow-unrelated-histories
这个功能是可以让大家不要把仓库上传错了,如果会加上这个代码,那么就是自己确定了上传。之前很容易就把代码传错了,现在可以看到,如果上传的仓库不是之前在上传的仓库,是一个新的仓库,那么就会提示需要添加上面代码才能上传
2019-11-29-git无法pull仓库refusing-to-merge-unrelated-histories的更多相关文章
- git无法pull仓库refusing to merge unrelated histories
本文讲的是把git在最新2.9.2,合并pull两个不同的项目,出现的问题如何去解决fatal: refusing to merge unrelated histories 我在Github新建一个仓 ...
- git无法pull仓库refusing to merge unrelated histories (拒绝合并不相关仓库)
原文地址 https://blog.csdn.net/lindexi_gd/article/details/52554159 本文讲的是把git在最新2.9.2,合并pull两个不同的项目,出现的问题 ...
- git pull fatal: refusing to merge unrelated histories
1.首先我github有个远程仓库,然后我本地有个仓库 本地仓库我新添加了一个文件,然后我去关联(git remote add origin git@github.com:qshilary/gitte ...
- git push时报错refusing to merge unrelated histories
1. 删除本地项目中的.git目录,然后向远程仓库提交代码的时候,重新配置后再次提交.会有冲突. 解决方式: git remote add origin [//your giturl] git pul ...
- 使用git pull提示refusing to merge unrelated histories
创建了一个origin,两个人分别clone 分别做完全不同的提交 第一个人git push成功 第二个人在执行git pull的时候,提示 fatal: refusing to merge unre ...
- git 错误 Reinitialized existing Git repository in /**/***/ 和refusing to merge unrelated histories
报错一: 这句话的意思是 在路径 /Users/jackma/Downloads/lotteryTicket 2/.git/ 现有的Git存储库初始化 ➜ lotteryTicket 2 git:(m ...
- git在使用中出现 refusing to merge unrelated histories如何解决?
一.GIT的使用 # 设置用户名 git config --global user.name "zhaijihai" # 设置用户邮箱 git config --global us ...
- git pull 解决 refusing to merge unrelated histories 错误
解决办法: 1.cmd进入项目的根目录. 2.执行下面的命令:git pull origin master --allow-unrelated-histories.可以提交成功. 3.再次push.
- 提交到开源git时出现:fatal: refusing to merge unrelated histories的解决办法
解决办法 创建本地库和fetch远程分支这些前面的步骤这里略过.可以自行百度. 解决办法: 1.cmd进入项目的根目录. 2.执行下面的命令:git pull origin master --al ...
- android studio提交到开源git时出现:fatal: refusing to merge unrelated histories的解决办法
创建本地库和fetch远程分支这些前面的步骤这里略过.可以自行百度. 解决办法: 1.cmd进入项目的根目录. 2.执行下面的命令:git pull origin master --allow-unr ...
随机推荐
- leetcode-easy-design-384 Shuffle an Array
mycode class Solution(object): def __init__(self, nums): """ :type nums: List[int] &q ...
- How to solve the error "Field service in com.xx.xxx.xxxx required a bean of type 'com.aa.bb.cc' that could not be found."
When runung a SpringBoot demo, I got a error as following: *************************** APPLICATION ...
- P2010 回文日期
P2010 回文日期 题解 回文日期,一共8位,只需要枚举4位就好了其实,然后判断它是否合法 代码 #include<bits/stdc++.h> using namespace std; ...
- 浏览器端-W3School-HTML:HTML DOM Select 对象
ylbtech-浏览器端-W3School-HTML:HTML DOM Select 对象 1.返回顶部 1. HTML DOM Select 对象 Select 对象 Select 对象代表 HTM ...
- Windows10安装秘钥大全
Windows10官方镜像下载地址: 点击下载 老毛桃U盘启动制作:点击下载 秘钥大全 家庭版: Core 家庭版:YTMG3-N6DKC-DKB77-7M9GH-8HVX7 单语言家庭版:BT79Q ...
- LoadRunner 技巧之 集合点设置
LoadRunner 技巧之 集合点设置 Loadrunner 技巧已经整理4篇了,你个一定疑问,这些知识点,网上随处可见.确实,由于长时间没有使用这个工具,造成我的一些概念开始在大脑中模糊,我只是用 ...
- Python字符和字符值(ASCII或Unicode码值)转换方法
Python字符和字符值(ASCII或Unicode码值)转换方法 这篇文章主要介绍了Python字符和字符值(ASCII或Unicode码值)转换方法,即把字符串在ASCII值或者Unicode值之 ...
- Idea创建项目后,提交项目到码云的问题
1.创建git仓库:vcs->import int version control->Create git repository 2.在项目头点击右键->git->add 3. ...
- sha256---利用java自带的实现加密
利用java自带的实现加密:参考https://jingyan.baidu.com/article/2fb0ba40a2ef2b00f3ec5f74.html /** * 利用java原生的摘要实现S ...
- Jmeter安装篇(win10)
参考博文:https://blog.csdn.net/a13124837937/article/details/79628838 以下是我按照参考博文进行的实际操作过程,此篇只为记录,尽量精简内容. ...