【问题标题】:GitHub error while pushing my code [duplicate]推送我的代码时出现GitHub错误[重复]
【发布时间】:2016-11-04 03:01:20
【问题描述】:

您好,谁能帮我解决这个 GitHub 错误?我没有明白我做错了什么。

To https://github..com/kumar/web.git
 ! [rejected]        develop -> develop (fetch first)
error: failed to push some refs to 'https://github..com/kumar/web.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.

【问题讨论】:

    标签: git github


    【解决方案1】:

    发生了什么是源服务器有一些你还没有拉下来的提交。

    我建议使用 rebase 来解决这个问题。

    一般你可以这样做:

    git fetch origin master
    git rebase origin/master
    git push origin master
    

    这会将您的提交放在分支的顶部,您之前没有的上游工作之后。

    【讨论】:

      猜你喜欢
      • 2018-03-28
      • 2012-11-06
      • 2023-03-16
      • 2020-01-21
      • 2012-10-29
      • 2016-12-30
      • 2016-03-18
      • 2022-01-07
      • 2021-04-16
      相关资源
      最近更新 更多