【问题标题】:! [rejected] master -> master (fetch first) when pushing to git! [rejected] master -> master (fetch first) 推送到 git
【发布时间】:2021-11-23 14:33:57
【问题描述】:

自从政策发生重大变化后——我使用了 SSH 密钥。 在进行更改之前一切顺利。

现在,当我尝试推送更改时,会弹出此错误:(

我推到了 2 个独立的分支。我是项目中唯一的开发者

! [rejected] master -> master (fetch first) error: failed to push some refs to 'github.com:kohenm63/phone_book.git' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

【问题讨论】:

标签: django github


【解决方案1】:

“这个分支提前 3 次提交,在 main 后面 3 次提交”。

对我来说很有意义。

确实使用了“强制”=>git push origin master --force 但只有当项目中有 1 个人在我的情况下适用时才会受到赞扬......

感谢大家的热心贡献!

【讨论】:

    猜你喜欢
    • 2019-07-29
    • 2015-04-10
    • 2020-07-27
    • 2012-11-05
    • 2011-11-24
    • 2016-11-13
    • 2012-07-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多