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的更多相关文章

  1. git无法pull仓库refusing to merge unrelated histories

    本文讲的是把git在最新2.9.2,合并pull两个不同的项目,出现的问题如何去解决fatal: refusing to merge unrelated histories 我在Github新建一个仓 ...

  2. git无法pull仓库refusing to merge unrelated histories (拒绝合并不相关仓库)

    原文地址 https://blog.csdn.net/lindexi_gd/article/details/52554159 本文讲的是把git在最新2.9.2,合并pull两个不同的项目,出现的问题 ...

  3. git pull fatal: refusing to merge unrelated histories

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

  4. git push时报错refusing to merge unrelated histories

    1. 删除本地项目中的.git目录,然后向远程仓库提交代码的时候,重新配置后再次提交.会有冲突. 解决方式: git remote add origin [//your giturl] git pul ...

  5. 使用git pull提示refusing to merge unrelated histories

    创建了一个origin,两个人分别clone 分别做完全不同的提交 第一个人git push成功 第二个人在执行git pull的时候,提示 fatal: refusing to merge unre ...

  6. git 错误 Reinitialized existing Git repository in /**/***/ 和refusing to merge unrelated histories

    报错一: 这句话的意思是 在路径 /Users/jackma/Downloads/lotteryTicket 2/.git/ 现有的Git存储库初始化 ➜ lotteryTicket 2 git:(m ...

  7. git在使用中出现 refusing to merge unrelated histories如何解决?

    一.GIT的使用 # 设置用户名 git config --global user.name "zhaijihai" # 设置用户邮箱 git config --global us ...

  8. git pull 解决 refusing to merge unrelated histories 错误

    解决办法: 1.cmd进入项目的根目录. 2.执行下面的命令:git pull origin master --allow-unrelated-histories.可以提交成功. 3.再次push.

  9. 提交到开源git时出现:fatal: refusing to merge unrelated histories的解决办法

    解决办法   创建本地库和fetch远程分支这些前面的步骤这里略过.可以自行百度. 解决办法: 1.cmd进入项目的根目录. 2.执行下面的命令:git pull origin master --al ...

  10. android studio提交到开源git时出现:fatal: refusing to merge unrelated histories的解决办法

    创建本地库和fetch远程分支这些前面的步骤这里略过.可以自行百度. 解决办法: 1.cmd进入项目的根目录. 2.执行下面的命令:git pull origin master --allow-unr ...

随机推荐

  1. spark MLlib 概念 6:ALS(Alternating Least Squares) or (ALS-WR)

    Large-scale Parallel Collaborative Filtering for the Netflix Prize http://www.hpl.hp.com/personal/Ro ...

  2. kolla-ansible-----常用命令

    常用命令 kolla-ansible prechecks -i multinode #部署前环境检测 kolla-genpwd #生成/etc/kolla/password.yml密码配置文件 kol ...

  3. cors 预请求

    1.CORS的其他限制 默认允许的方法只有:GET.HEAD.POST默认允许的Content-Type:text/plain.multipart/form-data.applicaton/x-www ...

  4. Linux_Ubuntu命令概述

    1.命令使用方法 Linux命令格式: command [-options] [parameter1] … 说明: command: 命令名,相应功能的英文单词或单词的缩写 [-options]:选项 ...

  5. BurpSuite(二) proxy 模块

      Proxy代理模块作为BurpSuite的核心功能,拦截HTTP/S的代理服务器,作为一个在浏览器和目标应用程序之间的中间人,允许你拦截,查看,修改在两个方向上的原始数据流. Burp 代理允许你 ...

  6. LinkedList简介

    原文:https://blog.csdn.net/GongchuangSu/article/details/51527042 LinkedList简介 LinkedList 是一个继承于Abstrac ...

  7. Linux_用户和权限管理

    目录 目录 用户管理基础知识 用户管理指令 useradd userdel passwd usermod chage su id who chmod chown s权限t权限 acl 用户管理基础知识 ...

  8. Vue+Python 电商实战

    安装webStorm  https://blog.csdn.net/qq_38845858/article/details/89850737 安装NodeJs  http://nodejs.cn/do ...

  9. MySQL 常见面试知识点

    之前简单总结了一下MySQL的场景面试知识点 1.讲下MVCC原理 2.MySQL高可用架构介绍 3.OSC(在线更改表结构)原理 4.MySQL性能调优有哪些关键点/经验 5.MySQL在线备份方案 ...

  10. this引用逸出

    1.定义 public class UnsafeClass { public UnsafeClass(Button button) { button.addActionListener(new Act ...