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时可能会出错,信息如下

  1. 此时很多人会尝试下面的命令把当前分支代码上传到master分支上。
    $ git push -u origin master
    但依然没能解决问题
  2. 出现错误的主要原因是github中的README.md文件不在本地代码目录中
  3. 可以通过如下命令进行代码合并【注:pull=fetch+merge]
    git pull --rebase origin master
  4.  执行上面代码后可以看到本地代码库中多了README.md文件
  5. 此时再执行语句 git push -u origin master即可完成代码上传到github

[转载]如何解决failed to push some refs to git的更多相关文章

  1. 解决failed to push some refs to git

    Administrator@PC-20150110FGWU /K/cocos2d/yc (master) $ git push -u origin master To git@github.com:y ...

  2. 如何解决failed to push some refs to git

    $ git push -u origin master To git@github.com:yangchao0718/cocos2d.git ! [rejected]        master -& ...

  3. GitHub上传项目时——解决failed to push some refs to git

    原文地址:https://jingyan.baidu.com/article/f3e34a12a25bc8f5ea65354a.html 遇到的问题: error: failed to push so ...

  4. 【转载】如何解决failed to push some refs to git

    在使用git 对源代码进行push到gitHub时可能会出错,信息如下   此时很多人会尝试下面的命令把当前分支代码上传到master分支上. $ git push -u origin master ...

  5. 解决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 ...

  6. 解决 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到本地,然后 解压后 ...

  7. failed to push some refs to 'git@github.com:xxx/xxx.git' 解决方法

    此时很多人会尝试下面的命令把当前分支代码上传到master分支上. $ git push -u origin master 但依然没能解决问题 会出现: failed to push some ref ...

  8. 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', 导致的原因 ...

  9. git中failed to push some refs to git问题解决及基本使用

    国庆归来准备试用一下git,在提交代码时遇到时遇到一些问题 提交时使用git push origin master 出现failed to push some refs to git 回想一下,创建该 ...

随机推荐

  1. 定时器quartz工具类

    一.gradle配置 // https://mvnrepository.com/artifact/org.quartz-scheduler/quartz compile group: 'org.qua ...

  2. js 数据结构-栈与队列

    /*[客栈的盘子/月井里的货物,后进先出]栈顶:最先入口/出口的位置栈底:最慢最晚出栈的位置*/ function Stack() { var item = []; //推(将货物推入月井) this ...

  3. java与数据库交互常用到的一些方法

    下面我整理了一下java中常用的几个与数据库交互的常用方法,仅供参考: 1.执行SQL(dao层的实现类中) (1)SQL查询: //import org.hibernate.Query;//impo ...

  4. unity, 最简单的additive shader

    Shader "Custom/myAdditive" {    Properties {                _MainTex ("Albedo (RGB)&q ...

  5. 自己动手写shell命令之write

    Linux下write命令同意用户跟其它终端上的用户对话.用c语言实现shell命令write.代码例如以下: #include <stdio.h> #include <fcntl. ...

  6. 子墨庖丁Android的ActionBar源代码分析 (一)实例化

    假设你从事过Androidclient开发,相信你对ActionBar这套框架并不陌生,或者说你并不了解它,可是你应该时不时的要跟它打交道.抛开ActionBar的实现不说,ActionBar实际上是 ...

  7. PHP遍历目录返回统计目录大小实例

    分享一个 PHP遍历目录并返回统计目录大小的方法.代码: <?php $dirname = "test1"; //mkdir($dirname); //遍历一层目录 func ...

  8. C++顺序容器vector、deque、list

    1.容器元素类型 C++中大多数数据类型能够作为容器的元素类型.容器元素类型必须满足一下两个条件:支持赋值和复制操作. 所以没有元素是引用类型的容器,同一时候IO对象和auto_ptr也不能作为容器的 ...

  9. linux io architecture

    http://www.cs.columbia.edu/~krj/os/lectures/L24-IO.pdf http://events.linuxfoundation.org/sites/event ...

  10. linux kernel & source code analysis& hacking

    https://kernelnewbies.org/ http://www.tldp.org/LDP/lki/index.html https://kernelnewbies.org/ML https ...