刚开始学习 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. angularJS MVC及$scope作用域

  2. Microsoft Windows 实用程序 Sysinternals Utilities Index

    最新页面时间:2017年5月16日 Sysinternals被MS收购--windows internals共近70多个工具集 Sysinternals套件 整套Sysinternals Utilit ...

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

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

  4. LeetCode1217 玩筹码(贪心)

    题目: 数轴上放置了一些筹码,每个筹码的位置存在数组 chips 当中. 你可以对 任何筹码 执行下面两种操作之一(不限操作次数,0 次也可以): 将第 i 个筹码向左或者右移动 2 个单位,代价为 ...

  5. uni-app开发小程序-使用uni.switchTab跳转后页面不刷新的问题

    uni.switchTab({ url: '/pages/discover/discover', success: function(e) { var page = getCurrentPages() ...

  6. Fedora Workstation 31众多功能得到改进

    导读 周一,Red Hat的桌面高级经理Christian F.K. Schaller分享了一篇博客文章,概述了Fedora Workstation 31的各种改进和特性.这些包括Wayland的改进 ...

  7. c#实现"扫描检测硬件改动"

    public static class Win32Api { public const int CM_LOCATE_DEVNODE_NORMAL = 0x00000000; public const ...

  8. maven启动报错No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

    [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building th ...

  9. linux下编译bochs-2.6.2

    操作系统: Fedora19 内核: 3.12.9 Linux localhost.localdomain 3.12.9-201.fc19.i686 #1 SMP Wed Jan 29 16:02:1 ...

  10. T_SQL 获取系统当前时间与明天时间的两种格式

    --获取系统明天的时间 select CONVERT(nvarchar(20),dateadd(d,1,getdate()),120)         2017-01-21 15:04:10 sele ...