github遇到问题Updates were rejected because the remote contains work that you do hint: not have locally.
文章目录
- 问题
- 原因
- 解决
问题
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.相关推荐
- 报错 hint: Updates were rejected because the remote contains work that you do 解决方法
https://blog.csdn.net/angduozu7316/article/details/101489264
- 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) 参考文章: ...
- 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 ...
- 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] ...
- 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的项目最新的同时,还需要保持你本地的项目与你产生的远程项目同步 对( ...
- 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 ...
- 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 ...
- 成功解决:Updates were rejected because the tip of your current branch is behind its remote...【解决方法】
一.报错发生 最近使用git,一直使用命令行操作.昨天突发奇想研究了一番git的GUI,结果由于操作不当产生了如下报错: Updates were rejected because the tip o ...
- 从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 ...
最新文章
- Linux下用于查看系统当前登录用户信息的4种方法
- 浅谈WebService的调用转
- CentOS7安装bbr的正确姿势:更新到7.3,安装elrepo官方4.9正式版
- Leet Code OJ 242. Valid Anagram [Difficulty: Easy]
- 剑灵力士卡刀ahk_技术宅教你:召唤代码一键卡刀详细教程帖
- 企业级IM应该帮助员工提高绩效,避免无关的信息干扰
- Hibernate延时加载
- 51单片机c语言显示hello,51单片机控制动态数码管显示12345和HELLO字样的设
- PyQt5-QComboBox控件使用实现省市级联效果
- CSS深入理解之border
- 三十不惑:情商智商决定我能走多快,德商(基本素质)决定我能走多远
- 基于阿里云API的图像文字识别
- A Tutorial on Learned Multi-dimensional Indexes
- 使用virt-manager 创建虚拟机
- MySQL创建用户,更改密码
- 串流直播流媒体视频发布平台功能模块和产品技术参数
- 读书笔记 -《疯狂Java讲义》(第5版)
- 解决Centos 7 下 tomcat字体异常 Font '宋体' is not available to the JVM
- android 将手机号中间隐藏为星号(*)和手机号码判断
- 各类消息队列MQ比较