文章目录

  • 问题
  • 原因
  • 解决

问题

azheng@lishizheng:/mnt/e/csapp_bilibili/ass$ git push origin main
To https://github.com/shizhengLi/csapp_bilibili.git
! [rejected] main -> main (fetch first)
error: failed to push some refs to ‘https://github.com/shizhengLi/csapp_bilibili.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.
azheng@lishizheng:/mnt/e/csapp_bilibili/ass$

原因

远程repo和本地的repo冲突所导致。例如笔者的问题是,本地readme文件未动,在github页面上更改了readme文件,导致了远程和本地的冲突。

解决

先把远程repo pull到本地,然后再push。

git pull origin main
git push origin main

github遇到问题Updates were rejected because the remote contains work that you do hint: not have locally.相关推荐

  1. 报错 hint: Updates were rejected because the remote contains work that you do 解决方法

    https://blog.csdn.net/angduozu7316/article/details/101489264

  2. github上的版本和本地版本冲突的解决方法(Updates were rejected because the tip of your current branch is behind)

    github上的版本和本地版本冲突的解决方法(Updates were rejected because the tip of your current branch is behind) 参考文章: ...

  3. Git工作笔记004---torisegit使用时Updates were rejected because the tip of your current branch i

    JAVA技术交流QQ群:170933152 因为要跟别的公司一块合作开发,我们用svn他们用git,现在又得用git 我在提交的时候:报如下错误: git.exe push --progress &q ...

  4. Git提交失败之 Updates were rejected because the tip of your current branch is behind

    错误显示 D:\devworkspace\ecpphoton\jcodef>git push To https://github.com/osxm/jcodef.git! [rejected] ...

  5. error: failed to push some refs to ‘xx.git‘ hint: Updates were rejected because the tip of your curr

    被fork的项目B<-你fork项目B产生的项目A<-别人fork你的项目B产生的项目C 作为中间人,需要保持你fork的项目最新的同时,还需要保持你本地的项目与你产生的远程项目同步 对( ...

  6. Updates were rejected because the tip of your current branch is behind

    项目场景: 今天学习torch的第二天 谁知我在git push -u origin master的时候报错了 问题描述 Updates were rejected because the tip o ...

  7. hint: Updates were rejected because the tip of your current branch is behind(git push线上与本地版本冲突问题)

    Git本地代码推送到线上出现的问题 错误信息为: error: failed to push some refs to 'http://**:**/**/**.git' hint: Updates w ...

  8. 成功解决:Updates were rejected because the tip of your current branch is behind its remote...【解决方法】

    一.报错发生 最近使用git,一直使用命令行操作.昨天突发奇想研究了一番git的GUI,结果由于操作不当产生了如下报错: Updates were rejected because the tip o ...

  9. 从git提交出现“updates were rejected because a pushed branch tip is behind its remote”到提交成功解决问题的过程

    git提交代码从reject到提交成功全过程 1. 问题重述 2. 解决过程 出现新问题:Your local changes to the following files would be over ...

最新文章

  1. Linux下用于查看系统当前登录用户信息的4种方法
  2. 浅谈WebService的调用转
  3. CentOS7安装bbr的正确姿势:更新到7.3,安装elrepo官方4.9正式版
  4. Leet Code OJ 242. Valid Anagram [Difficulty: Easy]
  5. 剑灵力士卡刀ahk_技术宅教你:召唤代码一键卡刀详细教程帖
  6. 企业级IM应该帮助员工提高绩效,避免无关的信息干扰
  7. Hibernate延时加载
  8. 51单片机c语言显示hello,51单片机控制动态数码管显示12345和HELLO字样的设
  9. PyQt5-QComboBox控件使用实现省市级联效果
  10. CSS深入理解之border
  11. 三十不惑:情商智商决定我能走多快,德商(基本素质)决定我能走多远
  12. 基于阿里云API的图像文字识别
  13. A Tutorial on Learned Multi-dimensional Indexes
  14. 使用virt-manager 创建虚拟机
  15. MySQL创建用户,更改密码
  16. 串流直播流媒体视频发布平台功能模块和产品技术参数
  17. 读书笔记 -《疯狂Java讲义》(第5版)
  18. 解决Centos 7 下 tomcat字体异常 Font '宋体' is not available to the JVM
  19. android 将手机号中间隐藏为星号(*)和手机号码判断
  20. 各类消息队列MQ比较

热门文章

  1. ORACLE普通表转换成分区表
  2. LeeCode_MultiplyStrings
  3. Openlayers 2.X加载高德地图
  4. Windows7 网上邻居设置
  5. 一个PHP程序的“怪问题”
  6. mnist 0与mnist x 相互衰变半衰期汇总
  7. P13 最优控制系统-《Matlab/Simulink与控制系统仿真》程序指令总结
  8. 2.4 残差网络为什么有用-深度学习第四课《卷积神经网络》-Stanford吴恩达教授
  9. STM32 电机教程 16 - PMSM电机磁场定向控制原理
  10. 准备入门IC的全局观念系列-中