码迷,mamicode.com
首页 > 其他好文 > 详细

Git error (failed to push some refs)解决

时间:2015-04-14 18:08:34      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:git-push   git   

当修改了本地仓库后 提交代码时, 用 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 (non-fast forward) 
error: failed to push some refs to ‘../remote/‘ 
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.  See the ‘non-fast forward‘
section of ‘git push --help‘ for details.

解决办法:
先把git的东西fetch到你本地然后merge后再push

$ git fetch
$ git merge
$ git push

Git error (failed to push some refs)解决

标签:git-push   git   

原文地址:http://blog.csdn.net/zwhlxl/article/details/45044181

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!