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 origin master
To git@github.com:******/Demo.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:******/Demo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
网上搜索了下,是因为远程repository和我本地的repository冲突导致的,而我在创建版本库后,在github的版本库页面点击了创建README.md文件的按钮创建了说明文档,但是却没有pull到本地。这样就产生了版本冲突的问题。
有如下几种解决方法:
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]
01_第一次如何上传GitHub(转)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 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] ...
- Git 报错:Updates were rejected because the tip of your current branch is behind
刚开始学习 git 命令,发现会出现很多的错误,所以就总结下出现的错误,以此来加深理解和掌握吧! 环境:在本地库操作了一系列的 add 和 commit 操作后,想把本地仓库推送到远端,但是发生以下错 ...
- git push时报错:Updates were rejected because the tip of your current branch is behind
出现这样的问题是由于:自己当前版本低于远程仓库版本 有如下几种解决方法: 1.使用强制push的方法: git push -u origin master -f 这样会使远程修改丢失,一般是不可取的, ...
- 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提交报错:Updates were rejected because the tip of your current branch is behind
提交代码push时报错:上网查询了一下解决办法有很多种,1.使用强制push的方法:(上网查询说这种会使远程修改丢失,一般是不可取的,尤其是多人协作开发的时候.) git push -u origin ...
- 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 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 ...
- 上传github文件及所出现的问题
上传github所发现的问题 准备工作 使用 git bush 输入下面的命令 git config --global user.email "you@example.com" g ...
随机推荐
- [转帖]TPC-C解析系列04_TPC-C基准测试之数据库事务引擎的挑战
TPC-C解析系列04_TPC-C基准测试之数据库事务引擎的挑战 http://www.itpub.net/2019/10/08/3331/ OceanBase这次TPC-C测试与榜单上Oracl ...
- 【工具】导入导出 Excel
文章目录 前言 当前支持的功能 方法api 配置 如何使用(Demo) 实现思路(该工具类可正确的一个大前提) 后记 前言 之前写的项目中,有个需求,需要导出导入Excel表格: 本来很简单的一件事, ...
- 08 IO流(五)——文件字符流FileWriter/FileReader
对比文件字节流的优势 对于文本文件的数据传输,使用文件字符流,就不用考虑编码转码的问题. 对比文件字节流,在方法上的不同有哪些 文件字符流有append方法: Writer append(char c ...
- PAT(B) 1049 数列的片段和(C)规律
题目链接:1049 数列的片段和 (20 point(s)) 题目描述 给定一个正数数列,我们可以从中截取任意的连续的几个数,称为片段.例如,给定数列 { 0.1, 0.2, 0.3, 0.4 },我 ...
- WUSTOJ 1337: Car race game(C)树状数组,离散化
题目链接:1337: Car race game 参考资料:⑴ Car race game 树状数组 棋煜,⑵ 树状数组,⑶ 离散化 补充资料:⑴ qsort,⑵ 二分查找 Description B ...
- Mybatis动态sql及分页、特殊符号
目的: mybatis动态sql(案例:万能查询) 查询返回结果集的处理 mybatis的分页运用 mybatis的特殊符号 mybatis动态sql(案例:万能查询) 根据id查询 模糊查询 (参数 ...
- Mybatis配置、逆向工程自动生成代码(CRUD案例)
目的: mybatis简介 搭建mybatis环境 基于SSM逆向工程的使用 Mybatis增删改查案例 mybatis简介 MyBatis 是一款优秀的持久层框架,它支持定制化 SQL.存储过程以及 ...
- 在论坛中出现的比较难的sql问题:32(row_number函数+子查询 sql循环取差值)
原文:在论坛中出现的比较难的sql问题:32(row_number函数+子查询 sql循环取差值) 所以,觉得有必要记录下来,这样以后再次碰到这类问题,也能从中获取解答的思路. sql循环取差值,该怎 ...
- 从零开始搭建一个简单的基于webpack的vue开发环境
原文地址:https://segmentfault.com/a/1190000012789253?utm_source=tag-newest 从零开始搭建一个简单的基于webpack的react开发环 ...
- KaiWu 的体验
KaiWu 的体验 来源 https://www.zhihu.com/question/28950444 >>>>>>>>>>>> ...