当前位置: 首页 > news >正文

远程的 develop 比你本地的 develop 更新,Git 拒绝直接覆盖

问题

cxq@DESKTOP-KS9ENIP MINGW64 /e/c++4/c-4 (develop)
$ git push origin develop
To https://gitee.com/beihangya/c-4.git ! [rejected]        develop -> develop (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/beihangya/c-4.git '
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details

原因:远程的 develop 比你本地的 develop 更新,Git 拒绝直接覆盖

解决路线

保守方案——先从远程仓库拉下来,然后将本地代码推送远程仓库

git pull origin develop --rebase   # 把远程新提交拿下来,再把你本地提交叠在后面
git push origin develop

如果有冲突,解决后继续 git rebase --continue → git push

http://www.dtcms.com/a/364318.html

相关文章:

  • Python爬虫实战: 纵横中文网小说爬取方案与代码实现
  • NLP插曲番外 · 猫猫狐狐问答夜话
  • AI+教育:用BERT构建个性化错题推荐系统
  • Chapter1—设计模式基础
  • More Effective C++ 条款25:将构造函数和非成员函数虚拟化
  • 外网获取瀚高.NET驱动dll方法和使用案例
  • WSL + VSCode + Git + Node.js 开发环境配置文档
  • uni-app与Vue3,实现3D圆柱形旋转画廊效果
  • 人工智能学习:什么是RNN模型
  • VMware Workstation 磁盘空间不足扩容
  • 二、Scala流程控制:分支与循环
  • C题目训练【三连击】
  • 【正则表达式】 正则表达式有哪些语法?
  • Spring中stereotype注解
  • Shell-AWK详解
  • EasyMeeting-注册登录
  • FART 自动化脱壳框架优化实战:Bug 修复与代码改进记录
  • Linux使用-Linux系统管理
  • 物联网时序数据存储方案:Apache IoTDB 集群部署全流程 + TimechoDB 优势解读
  • Debezium系列之:Flink SQL消费Debezium数据,只消费新增数据,过滤掉更新、删除数据
  • 苍穹外卖项目笔记day03
  • 【ShiMetaPi M4-R1】上手:RK3568B2|开源鸿蒙(OpenHarmony) 应用开发快速上手
  • 开源检索增强生成(UltraRAG)框架
  • KafkaRocketMQ重平衡容灾机制
  • 腾讯开源混元多语言翻译模型—— Hunyuan-MT
  • 【算法--链表】142.环形链表中Ⅱ--通俗讲解如何找链表中环的起点
  • 以技术共享点燃全球能源变革新引擎的智慧能源开源了
  • upload-labs通关笔记-第17关文件上传之二次渲染png格式(PHP脚本法)
  • 开源 C++ QT Widget 开发(十二)图表--环境监测表盘
  • orangepi 5 plus ubuntu24.04上安装redroid