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

【 Git 】git push 报错 error: failed to push some refs to ‘github.com/xxxx‘

git push 报错 error: failed to push some refs to 'github.com/xxxx'

        • 问题描述
        • 解决方案

问题描述

git push 的时候出现如下错误

To github.com:josk3/interviewTest.git
 ! [rejected]        main -> main (non-fast-forward)
error: failed to push some refs to 'github.com:josk3/interviewTest.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.

在这里插入图片描述

解决方案
  1. 要先进行 git pull 拉一下代码
  2. 如果出现 git pull 报错的话:error: Pulling is not possible because you have unmerged files.
    可以看一下我另外写的一篇文章:
    解决 git pull 报错的问题
  3. 然后直接 git push 即可

http://www.kler.cn/news/357134.html

相关文章:

  • git 与github 远程连接出现中文用户名乱码导致无法找到user/.ssh文件的解决办法
  • 桥接模式、NAT模式 和 主机模式(Host-Only)区别
  • 鸿蒙网络编程系列27-HTTPS服务端证书的四种校验方式示例
  • 【北京迅为】《STM32MP157开发板嵌入式开发指南》- 第五十章 Linux设备树
  • 申请软件测试CNAS实验室认证人员方面要做好哪些准备?
  • 若依框架中根目录与子模块 `pom.xml` 的区别
  • c4d哪个渲染器好用简单?c4d常用渲染器介绍
  • Spring篇(事务篇 - 基础介绍)
  • 【Python】基础语法
  • 计算机毕业设计 基于Python的汽车销售管理系统的设计与实现 Python毕业设计 Python毕业设计选题【附源码+安装调试】
  • 深入了解机器学习 (Descending into ML):线性回归
  • Dubbo的扩展与挑战拥抱微服务与云原生
  • Golang | Leetcode Golang题解之第486题预测赢家
  • 【设计模式】深入理解Python中的桥接模式(Bridge Pattern)
  • 【C语言】数据的定义、初始化、引用
  • Chromium 中chrome.contextMenus扩展接口实现分析c++
  • 超详细介绍bash脚本相关细节
  • manjaro kde 磁盘扩容
  • Leecode热题100-101.对称二叉树
  • 等保测评中的安全培训与意识提升