刚开始学习 git 命令,发现会出现很多的错误,所以就总结下出现的错误,以此来加深理解和掌握吧!

环境:在本地库操作了一系列的 add 和 commit 操作后,想把本地仓库推送到远端,但是发生以下错误:

错误情况:Updates were rejected because the tip of your current branch is behind

错误原因:我在远端 github 的版本库创建页面点击创建 README.md 按钮创建了说明文档,但是没有 pull 到本地,这样就产生了版本冲突问题。

解决方法:

1,使用强制 push 的方法:

# 该方法会使远程修改丢失,一般是不可取的,尤其是多人协作开发的时候
$ git push -u origin master -f

2,push 前先将远程 repo 修改 pull 下来

# 先 pull 下来,在次进行推送到远端
$ git pull origin master
$ git push -u origin master

Git 报错:Updates were rejected because the tip of your current branch is behind的更多相关文章

  1. git push时报错:Updates were rejected because the tip of your current branch is behind

    出现这样的问题是由于:自己当前版本低于远程仓库版本 有如下几种解决方法: 1.使用强制push的方法: git push -u origin master -f 这样会使远程修改丢失,一般是不可取的, ...

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

  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. vscode安装dlv插件报错:There is no tracking information for the current branch.

    vscode安装dlv插件报错:There is no tracking information for the current branch. https://blog.csdn.net/a7859 ...

随机推荐

  1. hadoop安装文档

    一.准备 该准备工作在三台机器上都需要进行,首先使用 vmvare 创建 1 个虚拟机,这台虚拟机是 master,一会需要把 master 克隆出两台 slave 点确定然后开启此虚拟机 然后添加/ ...

  2. Rails 第一课:环境配置 Ruby Rails RVM Heroku

    安装 上传专案到 Heroku 安装 Ruby 2.3.1 Rails 5.0.0.1 RVM 1.27.0 比较幸运一个问题都未碰到 MacOS 10.12.1 配置完成系统顺利升级到10.12.2 ...

  3. linux下安装redis,按照redis官网安装不成功需要提前安装c++环境(安装成功并可以测试)

    这个安装是一种便捷的安装,没有几句,但是完全按照官网上的来没有安装成功,有前提条件的 打开linux root登录 然后在usr下面建文件夹redis,进入 在该文件加下,直接按照官网的指导进行安装即 ...

  4. Spring源码分析——(001)环境搭建

    1.官方参考 spring-framework的github链接:https://github.com/spring-projects/spring-framework 源码环境搭建官方参考1:考如何 ...

  5. 在Windows中安装vim

    这篇文章主要教大家如何在Windows系统下安装最好用的编辑器VIM 来自百度百科的介绍: Vim是一个类似于Vi的著名的功能强大.高度可定制的文本编辑器,在Vi的基础上改进和增加了很多特性. VIM ...

  6. 实验吧-密码学-try them all(加salt的密码)、robomunication(摩斯电码)、The Flash-14(闪电侠14集)

    try them all(加salt的密码) 首先,要了解什么事加salt的密码. 加salt是一种密码安全保护措施,就是你输入密码,系统随机生成一个salt值,然后对密码+salt进行哈希散列得到加 ...

  7. Python MySQL 删除表

    章节 Python MySQL 入门 Python MySQL 创建数据库 Python MySQL 创建表 Python MySQL 插入表 Python MySQL Select Python M ...

  8. 51node 4个数和0

    https://www.51nod.com/Challenge/Problem.html#problemId=1267 第一种方法:两个for+二分:很好理解,不用考虑重复的问题.但是这个还不够快 # ...

  9. POJ-3984 迷宫问题(BFS找最短路径并保存)

    问题: 定义一个二维数组:  int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, ...

  10. 2016蓝桥杯决赛C/C++A组第四题 路径之谜

    题意: 小明冒充X星球的骑士,进入了一个奇怪的城堡.城堡里边什么都没有,只有方形石头铺成的地面. 假设城堡地面是 n x n 个方格.[如图1.png]所示. 按习俗,骑士要从西北角走到东南角.可以横 ...