[转载]如何解决failed to push some refs to git
Administrator@PC-20150110FGWU /K/cocos2d/yc (master)
$ git push -u origin master
To git@github.com:yangchao0718/cocos2d.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:yangchao0718/cocos2d.git
hint: Updates were rejected because the tip of your current branch is behin
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

在使用git 对源代码进行push到gitHub时可能会出错,信息如下
此时很多人会尝试下面的命令把当前分支代码上传到master分支上。$ git push -u origin master但依然没能解决问题
出现错误的主要原因是github中的README.md文件不在本地代码目录中
可以通过如下命令进行代码合并【注:pull=fetch+merge]git pull --rebase origin master
执行上面代码后可以看到本地代码库中多了README.md文件
此时再执行语句 git push -u origin master即可完成代码上传到github
[转载]如何解决failed to push some refs to git的更多相关文章
- 解决failed to push some refs to git
Administrator@PC-20150110FGWU /K/cocos2d/yc (master) $ git push -u origin master To git@github.com:y ...
- 如何解决failed to push some refs to git
$ git push -u origin master To git@github.com:yangchao0718/cocos2d.git ! [rejected] master -& ...
- GitHub上传项目时——解决failed to push some refs to git
原文地址:https://jingyan.baidu.com/article/f3e34a12a25bc8f5ea65354a.html 遇到的问题: error: failed to push so ...
- 【转载】如何解决failed to push some refs to git
在使用git 对源代码进行push到gitHub时可能会出错,信息如下 此时很多人会尝试下面的命令把当前分支代码上传到master分支上. $ git push -u origin master ...
- 解决failed to push some refs to 'git@github.com:TQBX/GIT-Github-.git'问题
解决以下问题问题: git pull origin master --allow-unrelated-histories 进入vim界面->ESC->:wq 重复第一步->git p ...
- 解决 failed to push some refs to 'git@github.com:zle1992/head-first-java' hint: Updates were rejected because the tip of your curr
问题描述: 寒假之前用实验室电脑push到github 上head first java 的程序,寒假回家后,想用自己的笔记本继续编,继续push . 我先从github下载zip到本地,然后 解压后 ...
- failed to push some refs to 'git@github.com:xxx/xxx.git' 解决方法
此时很多人会尝试下面的命令把当前分支代码上传到master分支上. $ git push -u origin master 但依然没能解决问题 会出现: failed to push some ref ...
- failed to push some refs to 'git@github.com:cq1415583094/MyBatis.git'解决办法
将本地git仓库代码提交到GitHub上时,出现failed to push some refs to 'git@github.com:cq1415583094/MyBatis.git', 导致的原因 ...
- git中failed to push some refs to git问题解决及基本使用
国庆归来准备试用一下git,在提交代码时遇到时遇到一些问题 提交时使用git push origin master 出现failed to push some refs to git 回想一下,创建该 ...
随机推荐
- EC20 minipcie版4g模块开发笔记
插在电脑上实验时若出现 AT+CREG? +CREG: 0,2 可能是usb口供电不足所致,换至主机箱后面usb口后问题解决,返回值+CREG: 0,1
- Html中meta标签详解--以前经常忽略的
W3School介绍:http://www.w3school.com.cn/html5/html5_meta.asp meta是用来在HTML文档中模拟HTTP协议的响应头报文. meta 标签的用处 ...
- HTML - 隐藏滚动条但可以滚动
代码:(原理就是遮盖) 1.如果你把子div的140px宽度移除,你就明白其中的奥妙了. 2.原理就是父元素负责滚动,子元素负责遮盖. <html> <style> .scro ...
- Docker介绍以及Registry的安装 -摘自http://dockone.io/article/108
本文介绍了Docker与Registry,作者说Docker是一个application hosting框架,亮点是简化应用的部署以及应用部署的版本控制.同时,作者介绍了Docker Registry ...
- Let's call it a "return"
Preface Long time no see. For some reason that I failed to keep updating this blog, which is really ...
- 用javascript获得地址栏参数的两种方法
javascript获得地址栏参数. 方法1: <script language="JavaScript"> //取地址栏参数 <!-- function Req ...
- [k8s]k8s 1.9(on the fly搭建) 1.9_cni-flannel部署排错 ipvs模式
角色 节点名 节点ip master n1 192.168.14.11 节点1 n2 192.168.14.12 节点2 n3 192.168.14.13 https://raw.githubuser ...
- 利用 FormData 对象发送 Key/Value 对的异步请求
使用Key/Value对和FormData能够轻易地通过XMLHttpRequest指定要传递什么数据,它是一个非常强大的发送数据到服务器的方法. 基础 通常的方法是你创建一个 FormData 对象 ...
- 快速写excel的方法
对于用com组件写excel,笔者表示那个太慢了.而且很耗资源,还要装excel. 今天我们就用写文本文件的方式来写excel. 步骤1,用excel写好一个设计一个我们想要的模板. 步骤2,我们把做 ...
- 多行文字在一个div中上下左右居中
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...