【问题标题】:how to solve error with pushing in github如何解决推入 github 的错误
【发布时间】:2019-04-07 12:53:42
【问题描述】:

我想像往常一样在 github 中推送我的项目。但我得到了这个错误。 这意味着什么,我应该怎么做?

! [rejected] master -> master(先获取) 错误:未能将一些参考推送到“https://github.com/mojt/profile4.git” 提示:更新被拒绝,因为遥控器包含您所做的工作 提示:本地没有。这通常是由另一个存储库推送引起的 提示:相同的参考。您可能希望首先集成远程更改 提示:(例如,'git pull ...')在再次推动之前。 提示:有关详细信息,请参阅“git push --help”中的“关于快进的说明”。

非常感谢您。

【问题讨论】:

  • Updates were rejected because the remote contains work that you do not have locally. This is usually caused by another repository pushing to the same ref. You may want to first integrate the remote changes (e.g., 'git pull ...') before pushing again. See the 'Note about fast-forwards' in 'git push --help' for details.
  • 它在错误中告诉你该怎么做。您在遥控器上进行了本地没有的更改。正如消息中所说,执行“git pull”应该可以修复它。
  • 非常感谢。这很有帮助

标签: git github


【解决方案1】:

错误消息的关键部分是这样的:

提示:更新被拒绝,因为远程包含您所做的工作提示:本地没有。

解决这个问题的方法可能只是拉一下:

git pull origin master

问题是您要求 GitHub 将一个或多个提交播放到一个与您实际进行这些提交的基础不同的基础上。通过首先拉取,您正在更新您的基础,以便 GitHub 可以接受您的提交。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-17
    • 2020-04-19
    • 2019-05-22
    • 2020-03-29
    相关资源
    最近更新 更多