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

gitte远程仓库修改后,本地没有更新,本地与远程仓库不一致

问题 :gitte远程仓库修改后,本地没有更新,本地与远程仓库不一致
现象:

[cxq@iZwz9fjj2ssnshikw14avaZ rpc]$ git push
Username for 'https://gitee.com': beihangya
Password for 'https://beihangya@gitee.com': 
To https://gitee.com/beihangya/rpc.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://gitee.com/beihangya/rpc.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 merge the remote changes (e.g.,
hint: 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

解决方案
1、拉取远程更改:
首先从远程仓库拉取最新的更改并合并到本地:

git pull origin master

如果有冲突,需要手动解决冲突。
2、解决冲突:
如果拉取过程中出现冲突,根据提示解决冲突
3、再次推送:
解决冲突并合并远程更改后,再次尝试推送:

git pull origin master

http://www.kler.cn/a/550871.html

相关文章:

  • 【Python爬虫(11)】从入门到精通:CSS选择器在Python爬虫中的深度解析(豆瓣电影实例)
  • 【git】工作场景下的 工作区 <-> 暂存区<-> 本地仓库 命令实战 具体案例
  • Kubernetes知识点总结(十)
  • Ubuntu 下 MySQL 安装与配置全攻略:从入门到精通
  • 网络安全扫描--基础篇
  • 华为云OBS配置方法
  • DeepSeek在新能源三电研发测试中的应用实践:从技术落地到效率跃迁
  • Android Studio:如何用一个store类管理事件、简化管理
  • VSCode运行Go程序报错:Unable to process `evaluate`: debuggee is running
  • YOLOv5 目标检测优化:降低误检与漏检
  • 对openharmony HDF驱动框架的C/S设计模式和单例类的说明
  • 高效高并发调度架构
  • 设计模式13:职责链模式
  • FlutterBoost 的具体使用
  • 【ISO 14229-1:2023 UDS诊断(会话控制0x10服务)测试用例CAPL代码全解析②】
  • 软件考研,选择华科还是科软?
  • Llama3.0论文学习笔记: The Llama 3 Herd of Models
  • Unity学习part3
  • ubuntu24基于虚拟机无法从主机拖拽文件夹
  • 数据结构:栈(Stack)及其实现