git push时报错: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 pull origin master
git push -u origin master
3.若不想merge远程和本地修改,可以先创建新的分支:
git branch [name]
然后push
git push -u origin [name]
我用了2的方法成功解决。
git push时报错:Updates were rejected because the tip of your current branch is behind的更多相关文章
- 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 ...
- Git 报错:Updates were rejected because the tip of your current branch is behind
刚开始学习 git 命令,发现会出现很多的错误,所以就总结下出现的错误,以此来加深理解和掌握吧! 环境:在本地库操作了一系列的 add 和 commit 操作后,想把本地仓库推送到远端,但是发生以下错 ...
- [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: fai ...
- (转)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提交报错:Updates were rejected because the tip of your current branch is behind
提交代码push时报错:上网查询了一下解决办法有很多种,1.使用强制push的方法:(上网查询说这种会使远程修改丢失,一般是不可取的,尤其是多人协作开发的时候.) git push -u origin ...
- 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 push时报错refusing to merge unrelated histories
1. 删除本地项目中的.git目录,然后向远程仓库提交代码的时候,重新配置后再次提交.会有冲突. 解决方式: git remote add origin [//your giturl] git pul ...
随机推荐
- JavaScript字符串相关
嘛,开头来个定义好了! 首先它是JavaScript基本数据类型之一.字符串由零或多个16位Unicode字符组成的字符序列,用''或者""表示. 它有一些转义序列,例如\n ...
- [译]《Sphinx权威指南》 - Sphinx入门
本章中,我们会讨论到Sphinx基础的安装.配置和维护.不要被“基础”这形容词糊弄而跳过这个章节.对于“基础”,我不是指简单到显而易见的东西,而是指所有人都会用到的功能. 一般来说,Sphinx会使用 ...
- Mybatis插入记录并返回MySQL自增主键
mapper Integer insertConfigAndGetId(CrawlerConfig config); xml <insert id="insertConfigAndGe ...
- 学号 20175201张驰 《Java程序设计》第7周学习总结
学号 20175201张驰 <Java程序设计>第7周学习总结 教材学习内容总结 第八章 String类能有效地处理字符序列信息,它的常用方法有: public int length()可 ...
- vue/cli3 配置相对路径
根目录下新建 vue.config.js 文件 const path = require('path') function resolve(dir){ return path.join(__dirna ...
- ROS学习备忘
1. remap的解释 For example, you are given a node that says it subscribes to the "chatter" top ...
- linux awk 常见字符串处理
awk指定输出列: awk '{print $0} file' #打印所有列awk '{print $1}' file #打印第一列 awk '{print $1, $3}' file #打印第一和第 ...
- JS全选反选功能
总选框:<input type="checkbox" class="all" name="all"> 子选框: <inpu ...
- EntityFramework Core:版本不一致问题
code first 更新数据库时候报版本不对或者未找到错误 解决方法: 在项目文件中添加以下节点: <PropertyGroup> <OutputType>Library&l ...
- ubuntu下zip文件操作
转自 https://blog.csdn.net/hpu11/article/details/71524013 .zip $ zip -r myfile.zip ./* 将当前目录下的所有文件和文件夹 ...