github - 如何覆盖已经push到git远程库的内容
phpcn_u1582
phpcn_u1582 2017-05-02 09:19:13
[Git讨论组]

在写个小项目,简单说就是经过了阶段a,阶段b和阶段c,阶段c已经push到了远程库。
我现在在我的本地库把版本reset到了阶段b,现在我希望能重新push,覆盖并舍弃已有的阶段c,但是遭到了拒绝:

 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:qianjiahao/chatroom.git'
hint: Updates were rejected because the tip of your current branch is behind
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.

现在该如何操作才能覆盖远程库的内容呢?

后来我就git pull,然后修改了后在push回去,不知道还有没有其他的解决方法。

phpcn_u1582
phpcn_u1582

全部回复(1)
怪我咯
git push --force
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号