解决Git推送错误non-fast-forward的方法
作者:小旭2021 时间:2022-09-28 11:07:49
平时工作过程中,git在push代码的时候有时会遇到如下的错误
错误原因
文件冲突,本地的代码和远程Repository中的文件个数不一致(即远程Repository中存在本地项目中不存在的文件)或本地得项目不是在远程Repository代码的基础上修改的。
解决方法一
#git提交被拒绝,提示(non-fast-forward);
#解决方法:
1. git fetch origin dev
#获取远程分支debug的修改
2. git merge origin dev
#合并远程分支debug
3. git pull origin dev
#更新本地分支
解决方法二
git pull -r
来源:https://www.cnblogs.com/chenyablog/p/9147932.html
标签:Git,推送,错误,non-fast-forward
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
我的ImageMagick使用心得
2008-10-21 11:05:00
![](https://img.aspxhome.com/file/UploadPic/200810/21/20081021122020655s.jpg)
修复 Mac brew 安装 mongodb 报 Error: No available formula with the name ‘mongodb’ 问题详解
2024-01-18 17:10:50
Golang命令行进行debug调试操作
2024-04-27 15:37:33
HTML+CSS 模仿Windows 7 桌面效果
2010-06-17 14:33:00
![](https://img.aspxhome.com/file/UploadPic/20106/17/1044050-15s.png)
GPU状态监测 nvidia-smi 命令的用法详解
2022-08-28 20:57:37
![](https://img.aspxhome.com/file/2023/7/135417_0s.png)
PyTorch一小时掌握之图像识别实战篇
2023-01-28 00:08:01
![](https://img.aspxhome.com/file/2023/3/134583_0s.png)
用python的seaborn画数值箱型图
2021-04-26 20:43:04
![](https://img.aspxhome.com/file/2023/3/66333_0s.jpg)
Oracle跨数据库查询并插入实现原理及代码
2024-01-14 18:52:58
修改、删除数据记录(DELETE\\UPDATE)
2009-02-27 15:50:00
关于Python作用域自学总结
2023-11-02 12:19:53
![](https://img.aspxhome.com/file/2023/7/83747_0s.jpg)
基于Tensorflow一维卷积用法详解
2022-12-31 20:04:18
![](https://img.aspxhome.com/file/2023/3/111923_0s.jpg)
python复制列表时[:]和[::]之间有什么区别
2021-08-15 01:22:05
浅谈python print(xx, flush = True) 全网最清晰的解释
2022-01-28 21:45:48
![](https://img.aspxhome.com/file/2023/7/76737_0s.jpg)
Python中几种属性访问的区别与用法详解
2022-12-24 23:36:20
mac安装python3后使用pip和pip3的区别说明
2021-01-06 21:23:15
![](https://img.aspxhome.com/file/2023/3/77553_0s.jpg)
Python实现学生成绩管理系统
2023-08-13 09:51:17
![](https://img.aspxhome.com/file/2023/1/62301_0s.jpg)
python3爬取各类天气信息
2022-01-18 06:09:35
![](https://img.aspxhome.com/file/2023/5/68865_0s.jpg)
Django Auth用户认证组件实现代码
2022-05-02 18:06:01
js实现div闪烁原理及实现代码
2024-04-16 09:05:02
Sql Server 2005数据库被标记为“可疑”问题
2009-12-15 10:50:00