问题背景:在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. 主席树+LCA【p2633 (bzoj2588】 Count on a tree

    Description 给定一棵N个节点的树,每个点有一个权值,对于M个询问(u,v,k),你需要回答u xor lastans和v这两个节点间第K小的点权.其中lastans是上一个询问的答案,初始 ...

  2. 洛谷——P1024 一元三次方程求解

    P1024 一元三次方程求解 题目描述 有形如:ax3+bx2+cx+d=0 这样的一个一元三次方程.给出该方程中各项的系数(a,b,c,d 均为实数),并约定该方程存在三个不同实根(根的范围在-10 ...

  3. ( 转 ) .net 操作 JWT

    GitHub: https://github.com/jwt-dotnet/jwt 1.JWT定义 JWT(Json Web Token)是一种用于双方之间传递安全信息的简洁的.URL安全的表述性声明 ...

  4. 编译boost到各个系统平台 mac,iOS,linux,android,wind

    编译boost到各个系统平台 mac,iOS,linux,android,wind git地址:https://github.com/czjone/boost git仓库:https://github ...

  5. 在energia中添加新的库

    很多时候energia提供的库不能够满足我们的需要,这个时候我们就要自己添加库到energia中.方法如下: 在energia目录下找到hardware目录 选择对应的单片机型号文件夹进入 进入lib ...

  6. 搭建SSH框架–搭建篇

    工具: IDE:My Eclipse 2015 数据库:Orcale 创建Web项目 1.1 名称:PersonalWeb 1.2 勾选创建web.xml 1.3 Finsh 搭建Spring框架 2 ...

  7. Delphi 通过SQLite3, SQLiteTable3 操作数据库

    var sql, sFile:string; db:TSQLiteDatabase;begin try sFile := G_AppPath + CH_IPC712Db; //if FileExist ...

  8. Telnet环境变量

    转:http://www.cnpaf.net/Class/Telnet/200408/2.html 当前位置: 网站首页>>协议大全>>TELNET协议>> Tel ...

  9. mormot数据库连接+查询+序列为JSON

    mormot数据库连接+查询+序列为JSON uses SynDB,SynCommons, SynDBRemote, SynOleDB, SynDBMidasVCL, mORMotMidasVCL p ...

  10. 【JVM】调优笔记1-----堆栈概念的对碰

    关于JVM的工作原理以及调优是一个向往已久的模块,终于有幸接触到:http://pengjiaheng.iteye.com/blog/518623 那就顺着这个思路,来梳理一下自己看到后的结论和感想. ...