刚开始学习 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. 如何将dmp文件导入到Oracle

    一.概述 在将dmp文件导入到Oracle中之前,需要先创建一个orcale用户.然后使用该用户名和密码,以imp的方式将数据导入到oracle中. 二.执行步骤 1.登陆oracle数据库 a.sq ...

  2. day09 Django: 组件cookie session

    day09 Django: 组件cookie session   一.cookie和session都是会话跟踪技术     1.什么是会话             可以理解为客户端和服务端之间的一次会 ...

  3. TBLASTN

    TBLASTN search translated nucleotide databases using a protein query

  4. SQL语句对MySQL数据库的操作之对数据库层面的操作

    一.数据库内部存储结构 字段->数据表->数据库->MySQL服务器 二.登录及退出数据库 mysql -h服务器地址 -u用户名 -p密码(这样的登录形式并不安全) mysql - ...

  5. PyTorch自动微分基本原理

    序言:在训练一个神经网络时,梯度的计算是一个关键的步骤,它为神经网络的优化提供了关键数据.但是在面临复杂神经网络的时候导数的计算就成为一个难题,要求人们解出复杂.高维的方程是不现实的.这就是自动微分出 ...

  6. 吴裕雄 Bootstrap 前端框架开发——Bootstrap 字体图标(Glyphicons):glyphicon glyphicon-facetime-video

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name ...

  7. 吴裕雄 Bootstrap 前端框架开发——Bootstrap 字体图标(Glyphicons):glyphicon glyphicon-text-width

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name ...

  8. Spring 事件(2)- 自定义事件

    Spring 系列教程 Spring 框架介绍 Spring 框架模块 Spring开发环境搭建(Eclipse) 创建一个简单的Spring应用 Spring 控制反转容器(Inversion of ...

  9. python连接 ssh

    import paramiko # private = paramiko.RSAKey.from_private_key() 秘钥 trans = paramiko.Transport((" ...

  10. Centos 7 x86_64 环境Python2.7升级Python3.7.4

    升级Python3.7.4 #安装补丁包yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel read ...