解决failed to push some refs to git

[email protected] /K/cocos2d/yc (master)

$ git push -u origin master

To [email protected]:yangchao0718/cocos2d.git

 ! [rejected]        master -> master (non-fast-forward)

error: failed to push some refs to ‘[email protected]: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.

出现错误的主要原因是github中的README.md文件不在本地代码目录中

可以通过如下命令进行代码合并【注:pull=fetch+merge]

git pull --rebase origin master

执行上面代码后可以看到本地代码库中多了README.md文件

此时再执行语句 git push -u origin master即可完成代码上传到github

时间: 2024-10-09 17:37:03

解决failed to push some refs to git的相关文章

[转载]如何解决failed to push some refs to git

[email protected] /K/cocos2d/yc (master) $ git push -u origin master To [email protected]:yangchao0718/cocos2d.git ! [rejected]        master -> master (non-fast-forward) error: failed to push some refs to '[email protected]:yangchao0718/cocos2d.git

如何解决failed to push some refs to git

[email protected] /K/cocos2d/yc (master) $ git push -u origin master To [email protected]:yangchao0718/cocos2d.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to '[email protected]:yangchao0718/cocos2d.git hint: U

解决 failed to push some refs to '[email protected]:zle1992/head-first-java' hint: Updates were rejected because the tip of your curr

问题描述: 寒假之前用实验室电脑push到github 上head first java 的程序,寒假回家后,想用自己的笔记本继续编,继续push . 我先从github下载zip到本地,然后 解压后,继续编程,但是用git push origin master 出现问题如下: 试了很多方法,最终解决方案如下: 思路: 新建一个文件夹,用pull 命令把文件从github下载下来,编写好新的程序,git add  git commit  git push 参考: http://www.tuico

error: failed to push some refs to ‘git@xxx.git‘

[问题描述]:通过 git push -u origin master 提交代码时出现如下报错: ##git push -u origin master Enumerating objects: 96, done. Counting objects: 100% (96/96), done. Delta compression using up to 4 threads Compressing objects: 100% (74/74), done. Writing objects: 100% (

GIT用git push出现failed to push some refs to git...的解决方法

错误提示: [email protected] /K/cocos2d/yc (master) $ git push -u origin master To [email protected]:yangchao0718/cocos2d.git ! [rejected]        master -> master (non-fast-forward) error: failed to push some refs to '[email protected]:yangchao0718/cocos2

解决failed to push some refs to

由于github我使用了dev和feature分支,团队合作合并到dev,个人开发都是feature....今天在本地feature中git pull origin dev 出现 在使用git 对源代码进行push到gitHub时可能会出错, 出现错误的主要原因是github中的README.md文件不在本地代码目录中 可以通过如下命令进行代码合并[注:pull=fetch+merge] git pull --rebase origin dev 执行上面代码后可以看到本地代码库中多了README

Git error (failed to push some refs)解决

当修改了本地仓库后 提交代码时, 用 git push 提示以下错误 error:failed to push some refs to ... Dealing with "non-fast-forward" errors From time to time you may encounter this error while pushing: $ git push origin master To ../remote/ ! [rejected] master -> master

如何解决git====push 过程中出现的。error: failed to push some refs

当我们在利用git  push 文件到仓库时出现了一下问题: ! [rejected] master -> master (fetch first)error: failed to push some refs to '[email protected]:yaogengzhu/ajax.git'hint: Updates were rejected because the remote contains work that you dohint: not have locally. This i

错误:error: failed to push some refs to 'https://github.com/pzq7025/KG.git'的解决办法

一.问题在进行[git push orgin master]的时候出现如下错误 ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/pzq7025/KG.git' hint: Updates were rejected because a pushed branch tip is behind its remote hint: counter