出现这样的问题是由于:自己当前版本低于远程仓库版本

有如下几种解决方法:

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

  1. 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 ...

  2. Git 报错:Updates were rejected because the tip of your current branch is behind

    刚开始学习 git 命令,发现会出现很多的错误,所以就总结下出现的错误,以此来加深理解和掌握吧! 环境:在本地库操作了一系列的 add 和 commit 操作后,想把本地仓库推送到远端,但是发生以下错 ...

  3. [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 ...

  4. (转)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] ...

  5. 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 ...

  6. git提交报错:Updates were rejected because the tip of your current branch is behind

    提交代码push时报错:上网查询了一下解决办法有很多种,1.使用强制push的方法:(上网查询说这种会使远程修改丢失,一般是不可取的,尤其是多人协作开发的时候.) git push -u origin ...

  7. 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 ...

  8. 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 ...

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

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

随机推荐

  1. Logstash - Working with plugins(使用插件)

    本章节开始介绍logstash的插件及功能,插件对于logstash来说非常重要,按类别分为:input.filter.codec.output四种类型. logstash有非常丰富的插件,通过安装目 ...

  2. 未能执行URL

    在 <compilation debug="true"> 下 加入: <buildProviders> <add extension=".h ...

  3. 随手科技(随手记)2017招聘Java工程师笔试题

    一  如何解决多台web服务器粘性会话的问题? 粘性session:web服务器会把某个用户的请求,交给tomcat集群中的一个节点,以后此节点就负责该保存该用户的session,如果此节点挂掉,那么 ...

  4. btcpool之StratumServer

    一.简介 StratumServer(简称sserver)接收JobMaker发送的stratumjob消息,从http api获取用户列表,对外部矿机提供服务. 二.处理stratumjob消息 s ...

  5. leetcode148. Sort List

    和数组里面的归并排序相同,用两个指针分别对应low high,递归进行归并排序然后merge把两个链表合在一起 /** * Definition for singly-linked list. * s ...

  6. Failed to set MokListRT: Invalid Parameter Something as gone seriously wrong: import_mok_state() failed: Invalid Parameter

    今天yum update升级centos7,重启后发现开不了机,报错如下: Failed to set MokListRT: Invalid ParameterSomething as gone se ...

  7. Hadoop集群故障诊断

    集群故障诊断通行方法:1.cloudera manager 监控和管理软件本身出问题了(没有任何数据),集群还是好的,业务还在正常跑:2.监控软件是好的,从监控里发现了很多问题,如CPU飙高.内存飙高 ...

  8. 转:select2 使用教程(简)

    用了这么久的Select2插件,也该写篇文章总结总结.当初感觉Select2不是特别好用,但又找不到比它更好的下拉框插件. 在我的印象里Select2有2个版本,最新版本有一些新的特性,并且更新了一下 ...

  9. Python练习:爬取图片

    贴吧地址 https://tieba.baidu.com/p/5272413637?red_tag=0606091703 程序如下import urllib.requestimport re def ...

  10. 【转】2、Jenkins构建完成自动发送邮件

    1.开通163邮箱的授权码服务,和SMTP服务.百度找教程.2.安装 Email Extension Plugin 插件,已安装或版本自带可跳过此步骤.3.进入系统管理–系统设置首先配置 Jenkin ...