yidou_wei 2022-03-31 20:12 采纳率: 0%
浏览 47

解决办法 git提交错误 error: failed to push some refs to 'https://github.com/问题

问题描述:在git bash中键入 $ git push 远程仓库 master 进行提交的时候出现 如下错误:
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/%7Dgit'
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.

img

看一些博客说强制提交之类的,但是对于我来说没有帮助
我的解决方案是:
1.先把自己远程仓库的pull拉到本地合并
** git pull 远程仓库 分支名**

img

2.再次提交就可以
** git push 远程仓库 分支名**

img

成功

  • 写回答

1条回答 默认 最新

  • threenewbee 2022-03-31 22:52
    关注

    是不是网络状况不佳。github还是用专门的方式访问比较好。

    评论

报告相同问题?

问题事件

  • 创建了问题 3月31日

悬赏问题

  • ¥15 创建一个数据库(要创建的表和记事本的代码截图))
  • ¥15 有没有整苹果智能分拣线上图像数据
  • ¥20 有没有人会这个东西的
  • ¥15 cfx考虑调整“enforce system memory limit”参数的设置
  • ¥30 航迹分离,航迹增强,误差分析
  • ¥15 Chrome Manifest扩展引用Ajax-hook库拦截请求失败
  • ¥15 用Ros中的Topic通讯方式控制小乌龟的速度,走矩形;编写订阅器代码
  • ¥15 LLM accuracy检测
  • ¥15 pycharm添加远程解释器报错
  • ¥15 如何让子窗口鼠标滚动独立,不要传递消息给主窗口