VSCODE解决git合并过程中的冲突问题;error: failed to push some refs to

1:异常现象

推送有冲突的git修改到远端的时候,会有如下提示

git.exe push --progress "origin" master:master

To http://gitlab.xxx.com/dujunqiu/test.git

! rejected master -> master (fetch first)

error: failed to push some refs to 'http://gitlab.xxx.com/dujunqiu/test.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.

git did not exit cleanly (exit code 1) (1172 ms @ 2024/3/9 15:59:25)

2:修改方式

注意这里需要将VSCODE版本更新为1.8x;1.7x的版本可能不支持 GitLens;

安装如下两个插件
直接把 远端合并有冲突的分支拉取一下
本地就会显示有冲突提示了
选择 "在合并编辑器中解析";根据界面提示,选择左侧或者右侧的内容之后,点击 "完成合并"
此时再push到git就不会有合并冲突了

相关推荐
玄芯散人19 小时前
【筑基·058】Git协作工作流:冲突解决和PR流程
git·版本控制·团队协作
寺中人1 天前
Git 版本控制完全入门指南:从安装到实战,提交 + 分支 + 协作 + 冲突解决全拆解
git·开发工具·版本控制·团队协作·代码管理
荔枝梅梅1 天前
新手程序员 SSH 第一课:从 Git 仓库连接失败理解 SSH 协议与密钥配置
git
玄芯散人1 天前
【筑基·057】Git代码时光机:版本控制入门到分支管理
git·版本控制·嵌入式开发
szephyr1 天前
Git 分支管理实战:feature/release/hotfix 怎么用才不乱
git·分支管理·团队协作·工作流·hotfix
一木 之林1 天前
手搓家庭服务器:二手装机、Docker部署、端口映射与frp内网穿透
服务器·人工智能·git·编辑器
烛之武1 天前
Git教程笔记
git·gitee
Sharewinfo_BJ1 天前
PBIP项目结构与文件解析
git·powerbi·智信bi·上北智信
Hvitur2 天前
Linux安装Git【离线安装】
git
howard20052 天前
6.4 Git安装与配置
git·安装配置