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 ...
随机推荐
- Android studio 3.1.3真机调试报错,no target device found
Android studio 3.1.2 的 Android monitor 改为 Android profiler,直接点这个就可以真机调试,在手机安装相应app 如果不行,报错,"no ...
- 【计数DP】种树
种树 题目描述 事实上,小X邀请两位奆老来的目的远不止是玩斗地主,主要是为了抓来苦力,替他的后花园种树……小X的后花园是环形的,他想在花园周围均匀地种上n棵树,但是奆老花园的土壤当然非同寻常,每个位置 ...
- ALV报表——基础(一)
目录 一.ALV的简介 二.程序实现 2.1.实现步骤 2.2.代码示例 三.Layout.Fieldcat相关属性,ALV输出函数 3.1.Layout相关属性 3.2.Fieldcat相关属性 3 ...
- 使用querySelector添加移除style和class
document.querySelector(selector).style.styleName = 样式 对dom节点添加一个样式 document.querySelector(".nam ...
- Python 在气象上的应用
Python 在气象上的应用 grug350关注 0.7892019.03.15 23:19:31字数 913阅读 1,024 为什么选择python 免费和开源,没有商业许可限制anaconda p ...
- vue常用时间修饰符记录
1.stop:阻止冒泡 如下:正常情况下,我们点击最内层的inner_inner的时候,事件会向上冒泡,inner 和outer也会执行.我们在inner_inner事件加上.stop修饰符,就会阻止 ...
- 稀疏检出-使用git检索出仓库里的某一个目录文件,而不是整个仓库的所有文件
具体工作意义是从某一个Git仓库 克隆时,只克隆检测出这个仓库里的某些文件夹内容,而不是跟平常那样把整个仓库的内容都克隆下来 从1.7.0版本开始git提供稀疏检出的功能.所谓稀疏检出就是本地版本库检 ...
- 一、Windows docker入门篇
win7.win8 等需要利用 docker toolbox 来安装,国内可以使用阿里云的镜像来下载,下载地址:http://mirrors.aliyun.com/docker-toolbox/win ...
- 解决Vs控制台程序出现NuGet\profile.ps1,因为在此系统上禁止运行脚本错误时或提示:“无法加载文件 \.nuget\packages\Microsoft.EntityFrameworkCore.Tools\1.1.0-preview4-final\tools\init.ps1,因为在此系统上禁止运行脚本”
1,打开Windows PowerShell 2.输入 set-executionpolicy remotesigned 即可执行脚本 如果执行命令失败的话重新选择Windows PowerShell ...
- Windows下编译 Hadoop
Windows下编译 Hadoop-2.9.2 系统环境 系统: Windows 10 10.0_x64 maven: Apache Maven 3.6.0 jdk: jdk_1.8.0_201 Pr ...