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

git push -f

时间:2017-03-30 17:45:57      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:fast   class   failed   git   本地   com   lib   成本   rem   

有的时候使用GIT工作时,会遇到一下这种问题,
Pushing to git@github.com:519ebayproject/519ebayproject.git
To git@github.com:519ebayproject/519ebayproject.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to ‘git@github.com:519ebayproject/519ebayproject.git‘
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. ‘git pull‘)
hint: before pushing again.
hint: See the ‘Note about fast-forwards‘ in ‘git push --help‘ for details.
我遇到造成这个问题的原因,一般是因为执行了git reset命令,版本回退后没有恢复,造成本地仓库的提交版本号落后于远端仓库的提交版本号。
可以执行 git push -f命令去强制提交

git push -f

标签:fast   class   failed   git   本地   com   lib   成本   rem   

原文地址:http://www.cnblogs.com/chenzc/p/6646646.html

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