$ git push -u origin "master" [rejected]

$ git push -u origin "master"
To https://gitee.com/ee/0523.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/ee/0523.git'
hint:

Updates were rejected because a pushed branch tip is behind its remote counterpart.

Check out this branch and integrate the remote changes (e.g. 'git pull ...') before pushing again.
See the 'Note about fast-forwards' in 'git push --help' for details.

============================

 强推: 

git push --force-with-lease origin 本地分支名:远端分支名
git push --force origin master:master

============================

 如果强制推送,则可能会给签出该分支的所有其他用户造成问题。风险较小的解决方案是从分离的头创建一个临时分支,然后将该分支合并到主分支中:

git branch temp-branch
git checkout master
git merge temp-branch
git push origin master

============================
posted @   emanlee  阅读(11)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
历史上的今天:
2023-05-23 BERT模型
2009-05-23 使用Sliverlight 2.0 IIS配置(部署,发布)
点击右上角即可分享
微信分享提示