git push ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/Operater9/guest' hint: Updates were rejected because the tip of your current bra
2024-09-01 07:21:58
推送本地代码到github报错
git push报错
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/Operater9/guest'
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.
查了资料后发现是本地没有update到最新版本的项目(git上有README.md文件没下载下来)
本地直接push所以会出错。
执行下面的拉命令,还是不行
$ git pull origin master
From https://github.com/Operater9/guest
* branch master -> FETCH_HEAD
fatal: refusing to merge unrelated histories
执行下面代码
参考https://stackoverflow.com/questions/24114676/git-error-failed-to-push-some-refs-to
git pull --rebase origin master
发现此时已经把github上最新的文件下载下来了:也就是README.md文件。
接着执行推送
git push -u origin master
成功推送本地代码到远程仓库
参考https://blog.csdn.net/u013120247/article/details/53263169
最新文章
- WPF计算
- Node.js在Windows与Linux下的安装
- osx的终端软件iterm2 之 修改外观 和 常用快捷键小结
- Dynamic Morphing Square(动态变形矩阵)
- Codeforces Round #359 (Div. 2) D. Kay and Snowflake 树DP
- ASP.NET获取路径的方法
- 射频识别技术漫谈(5)——防冲突【worldsing 笔记】
- PHP判断远程图片或文件是否存在
- Ubuntu常用命令速查手册-珍藏版-完整版
- Cracking the Coding Interview(Stacks and Queues)
- GDB调试程序常用命令
- Tomcat用法--Servlet开发
- Linux防火墙配置—访问外网WEB
- yii2 命令行执行php命令 commands(命令)
- FCC(ES6写法) Symmetric Difference
- 饮冰三年-人工智能-Python-22 Python初识Django
- FreeSWITCH收到重复的DTMF信号
- ASP.NET中上传图片检测其是否为真实的图片 防范病毒上传至服务器
- 学习 TList 类的实现[2]
- Red Hat 7.5 Yum Replacement
热门文章
- rf中的条件判断与循环
- Linux服务器相关信息查询
- Docker 0x13: Docker 构建集群/服务/Compose/分布式服务栈
- Docker 0x03:Install Docker
- ingress controller 注解使用
- ELK快速入门(一)基本部署
- asp.net中的参数传递:Context.Handler 的用法
- jmeter针对websocket协议的压测
- 修复wecenter移动版description首页描述一样问题
- Sitemap Error : XML declaration allowed only at the start of the document解决方法