[git] Updates were rejected because the tip of your current branch is behind its remote counterpart.
场景
$ git push
To https://github.com/XXX/XXX
! [rejected] dev -> dev (non-fast-forward)
error: failed to push some refs to 'https://github.com/XXX/XXX'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
原因
远端冲突
解决方案
推荐方案3
因为merge会新建commit, 让网络图错综复杂, 十分难观察
git push --force
暴力更新代码, 这样会丢失远端的一些提交(或者代码)git pull ( fetch + merge )
本地取远端修改, 然后合并git pull -- rebase ( fetch + rebase )
本地取远端修改, 然后变基
merge 与 rebase 的区别
merge 是新建一个commit, 在新的commit中, 在两个分支上各取最近祖先至今的修改, 合并, 移动head到最新分支上.
rebase是不新建commit, 首先剪切本分支最近祖先至今的修改, 然后移动head到另一分支. 在另一个分支上, 粘贴刚才的修改, 移动head到最新修改上.
具体详见https://www.jianshu.com/p/c17472d704a0
[git] Updates were rejected because the tip of your current branch is behind its remote counterpart.的更多相关文章
- Git 报错:Updates were rejected because the tip of your current branch is behind
刚开始学习 git 命令,发现会出现很多的错误,所以就总结下出现的错误,以此来加深理解和掌握吧! 环境:在本地库操作了一系列的 add 和 commit 操作后,想把本地仓库推送到远端,但是发生以下错 ...
- (转)Updates were rejected because the tip of your current branch is behind
刚创建的github版本库,在push代码时出错: $ git push -u origin masterTo git@github.com:******/Demo.git ! [rejected] ...
- 01_第一次如何上传GitHub(转)Updates were rejected because the tip of your current branch is behind
https://www.cnblogs.com/code-changeworld/p/4779145.html 刚创建的github版本库,在push代码时出错: $ git push -u orig ...
- git push时报错:Updates were rejected because the tip of your current branch is behind
出现这样的问题是由于:自己当前版本低于远程仓库版本 有如下几种解决方法: 1.使用强制push的方法: git push -u origin master -f 这样会使远程修改丢失,一般是不可取的, ...
- git提交报错:Updates were rejected because the tip of your current branch is behind
提交代码push时报错:上网查询了一下解决办法有很多种,1.使用强制push的方法:(上网查询说这种会使远程修改丢失,一般是不可取的,尤其是多人协作开发的时候.) git push -u origin ...
- git提交时报错:Updates were rejected because the tip of your current branch is behind
有如下3种解决方法: 1.使用强制push的方法:git push -u origin master -f这样会使远程修改丢失,一般是不可取的,尤其是多人协作开发的时候. 2.push前先将远程rep ...
- Updates were rejected because the tip of your current branch is behind 问题出现解决方案
提供如下几种方式: 1.使用强制push的方法(多人协作时不可取): git push -u origin master -f 2.push前先将远程repository修改pull下来 git pu ...
- git push ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/Operater9/guest' hint: Updates were rejected because the tip of your current bra
推送本地代码到github报错 git push报错 ! [rejected] master -> master (non-fast-forward) error: failed to push ...
- Git出现There is no tracking information for the current branch提示的解决办法
参考:https://blog.csdn.net/sinat_36246371/article/details/79738782 在执行git pull的时候,提示当前branch没有跟踪信息: Th ...
随机推荐
- leetcode-hard-array-149. Max Points on a Line -NO
mycode 不会.... 参考 因为每次遍历一个点,也就是i的时候,都是新建的一个lines,所以也就是考虑了k相同b不同的情况 最后gcd函数就求最大公约数,来解决斜率精度的问题 class S ...
- ubuntu下如何安装7z压缩工具?
答: sudo apt-get install p7zip 1. 解压 7zr x filename.7z 2. 压缩 7zr a -t7z -r filename.7z ~/filename/* 各 ...
- Oracle Database的基本概念
一个 Oracle 服务器:是一个关系数据库管理系统(RDBMS),它提供全面的, 近乎完整的信息管理由Oracle 实例和Oracle 数据库组成Oracle 数据库 和 Oracle 实例Orac ...
- Aria2Gee 教程
改定履历 Aria2Gee是什么 开始之前 aria2 frp Aria2Gee可能存在的问题 初级教程 插件的安装 运行状态说明 下载测试 进阶教程 下载百度网盘文件 网盘助手的安装 网盘助手的配置 ...
- 实时更新Excel文档外部数据源的数据
实时更新Excel文档外部数据源的数据 单元格区域.Excel 表.数据透视表或数据透视图均可以连接到外部数据源(数据源:用于连接数据库的一组存储的"源"信息.数据源包含数据库服务 ...
- playbook部署coredns
playbook部署coredns 说明test1是主控节点,目的是给test4 node节点安装coredns, 1.coredns-1.2.2.tar.gz安装包放到主控节点/server/sof ...
- 20190603 - CentOS 7 提示 Failed to load SELinux policy. Freezing 导致卡住不启动的解决办法
现象 最近 Windows 和两台 Mac 混用,将 Windows VirtualBox 中安装的 CentOS 7 拷贝到 Mac 上. 启动 CentOS 7 时,图形界面进度卡在最后,按 Es ...
- 浏览器F12功能键对测试工程师的重要性
F键,功能键,Function键.F12常用于网站界面测试.调试,分析网页所出现的问题,查看html元素.查看响应事件等方面. 打开一个网页,点击F12,弹出一个窗口,其窗口的功能如下: 1 Elem ...
- slice详解
- Linux服务知识点总结
一.firewalld防火墙 1.firewalld简述 firewalld:防火墙,其实就是一个隔离工具:工作于主机或者网络的边缘.对于进出本主机或者网络的报文根据事先定义好的网络规则做匹配检测,对 ...