问题背景:在GitHub上创建了一个repositorie, 本地初始化并添加了远程仓库后,在GitHub上创建了一个README.md文件(注意不是从本地git push上去的),随后本地修改工程源码再次git push时,报错。。。。

To https://git.oschina.net/erchoc/laradock.git

 ! [rejected]        dev -> dev (fetch first)

error: failed to push some refs to 'https://git.oschina.net/erchoc/laradock.git'

hint: Updates were rejected because the remote contains work that you do

hint: not have locally. This is usually caused by another repository pushing

hint: to the same ref. You may want to first integrate the remote changes

hint: (e.g., 'git pull ...') before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.

解决方案:

# 先输入git pull
$ git pull # 再git push
$ git push origin master

  

参考链接: http://www.jianshu.com/p/ea6ec80ad5f2

注:报错信息copy参考链接里的代码。

一个关于git push失败的解决方案的更多相关文章

  1. Git学习之常见错误 git push 失败

    Git学习之常见错误 git push 失败 问题描述: git push Counting objects: , done. Delta compression using up to thread ...

  2. git push失败

    不知道弄错了什么上传项目到github上失败 git commit的时候提示 On branch masternothing to commit, working tree clean git pus ...

  3. Git复习(五)之多人协作、git push失败、git pull失败

    多人协作 多人协作时,大家都会往master和dev分支上推送各自的修改. 现在,模拟一个你的小伙伴,可以在另一台电脑(注意要把SSH Key添加到GitHub)或者同一台电脑的另一个目录下克隆: $ ...

  4. git push失败的解决办法(2)

    错误一:Cannot rebase: You have unstaged changes 解决办法: Cannot rebase: You have unstaged changes. 那说明有修改过 ...

  5. git push失败the remote end hung up unexpectedly

    Git Push是老是失败,提示: fatal: the remote end hung up unexpectedly git did not exit cleanly (exit code 1) ...

  6. git push 失败出现error: src refspec master does not match any.解决方案

    今天写好一个demo往GitHub上传时报错 错误提示: error: src refspec master does not match any. error: failed to push som ...

  7. git push 失败

    先上图 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvV29KaWFvRGFaaG9uZw==/font/5a6L5L2T/fontsize/400/fil ...

  8. Git: Push rejected 的解决方案

    Push rejected: Push to origin/master was rejected 首先,git init (在工程文件夹下) git remote add [-t <branc ...

  9. git clone 失败问题解决方案

    第一次从github上通过终端pull项目,出现了上述问题.询问了后台,才知道原来是电脑公钥(publickey)未添加至github,所以无法识别. 因而需要获取本地电脑公钥,然后登录github账 ...

随机推荐

  1. centos中pyenv安装

    1.先安装git yum install git -y 2.克隆pyenv到本地 git clone git://github.com/yyuu/pyenv.git .pyenv 或自动安装 curl ...

  2. 9、Flask实战第9天:类视图

    之前我们接触的视图都是函数,所以一般简称为视图函数.其实视图函数也可以基于类来实现,类视图的好处是支持继承,写完类视图需要通过app.add_url_rule(url_rule, view_func) ...

  3. 谜题27:变幻莫测的i值

    与谜题26中的程序一样,下面的程序也包含了一个记录在终止前有多少次迭代的循环.与那个程序不同的是,这个程序使用的是左移操作符(<<).你的任务照旧是要指出这个程序将打印什么.当你阅读这个程 ...

  4. CodeForces - 981G Magic multisets

    假设我们可以对每个位置快速维护一个数组,记录每个位置有哪些值是已经出现了的,哪些值是没有出现的,这样就可以决定修改的时候到底是 *2 还是 +1了. 但是很可惜,并不存在功能这么强大的数组,所以只能另 ...

  5. 【Floyd】【Dilworth定理】【最小路径覆盖】【匈牙利算法】bzoj1143 [CTSC2008]祭祀river

    Dilworth定理,将最长反链转化为最小链覆盖.//貌似还能把最长上升子序列转化为不上升子序列的个数? floyd传递闭包,将可以重叠的最小链覆盖转化成不可重叠的最小路径覆盖.(引用:这样其实就是相 ...

  6. [POI2001]Peaceful Commission

    题目大意: 有n个国家要派代表开会,每个国家有两个代表可供选择. 有m对代表有仇,不能同时开会. 若每个国家只能派一个代表开会,问是否存在一种方案,使得每个国家都能正常参会? 如果有,输出字典序最小的 ...

  7. iOS计算富文本(NSMutableAttributedString)高度

    有时候开发中我们为了样式好看, 需要对文本设置富文本属性, 设置完后那么怎样计算其高度呢, 很简单, 方法如下: - (NSInteger)hideLabelLayoutHeight:(NSStrin ...

  8. microsoft visual studio遇到了问题,需要关闭

    http://www.microsoft.com/zh-cn/download/confirmation.aspx?id=13821 装上这个补丁: WindowsXP-KB971513-x86-CH ...

  9. .NET反编译

    http://www.cnblogs.com/powertoolsteam/archive/2011/01/05/1926066.html

  10. u-boot支持LCD显示(基于TQ2440)

    平台简介 Linux版本:Linux-3.14 u-boot版本:u-boot-2015.04 硬件:TQ2440(内存:64MB  NandFlash:256MB) 作者:彭东林 邮箱:pengdo ...