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. C++11新特性(1) 右值引用

    在C++中,左值(lvalue)是能够获取其地址的一个量.因为常常出如今赋值语句的左边.因此称之为左值.比如一个有名称的变量. 比如: int a=10; //a就是一个左值. 传统的C++引用,都是 ...

  2. NET使用NPOI组件将数据导出Excel-通用方法 【推荐】

    一.Excel导入及导出问题产生:   从接触.net到现在一直在维护一个DataTable导出到Excel的类,时不时还会维护一个导入类.以下是时不时就会出现的问题:   导出问题:   如果是as ...

  3. [sql]mysql启停脚本

    写了个较为完善的mysql多实例的启动停止脚本. [root@lanny 3307]# cat mysql #!/bin/sh [ $# != 1 ]&&{ echo "US ...

  4. Interception c# code

    http://www.codetails.com/2012/12/02/intercepting-method-calls-using-il/20121202/ http://blogs.msdn.c ...

  5. Loadrunner常用操作

    LoadRunner 参数化 为什么需要参数化? 大众理解:为了更加真实的模拟用户操作 底层原理: 1,应用服务,数据库会校验该值的唯一性(unique key) 2,为了避免数据库的查询缓存对性能测 ...

  6. Spark的性能调优

    下面这些关于Spark的性能调优项,有的是来自官方的,有的是来自别的的工程师,有的则是我自己总结的. Data Serialization,默认使用的是Java Serialization,这个程序员 ...

  7. vs2010静态链接Qt

    先按照这个帖子弄好静态库 http://www.cnblogs.com/rollenholt/articles/2518642.html 注意原文中config那一步最后一个"-" ...

  8. vue自动化单元测试

    // 引用vue和需要测试的组件 import Vue from 'vue' import HelloWorld from '@/components/HelloWorld' // 创建测试套件,一个 ...

  9. NOR FLASH驱动程序

    NOR                                  NAND接口:    RAM-Like,引脚多                 引脚少,复用容量:  小 1M 2M 3M   ...

  10. 修改mysql root账户登录密码

    打开mysql.exe(如果你配置了path的话,打开cmd即可)键入: mysqladmin -u root -p password [你的新密码][回车] 然后会要求你输入你当前的密码,就修改成功 ...