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就不会有合并冲突了

相关推荐
kyriewen1 小时前
我让AI替我写Git提交信息,老板以为我每天工作16小时
前端·javascript·git
難釋懷3 小时前
Redis网络模型-单线程和多线程网络模型变更
网络·redis·git
不做无法实现的梦~3 小时前
Git 新手到团队协作与 GitHub/GitCode 指南
git·github·gitcode
谷哥的小弟4 小时前
(最新版)Git&GitHub实操图文详解教程(02)—安装Git
git·github·安装·配置·下载·图文教程
高斯林.神犇4 小时前
Git远程仓库操作流程
git
谷哥的小弟4 小时前
(最新版)Git&GitHub实操图文详解教程(01)—Git的起源
git·github
小此方4 小时前
Re:Linux系统篇(十四)工具篇 · 五:Git 高效协作实战与“三板斧”秘籍
linux·git·github
拾-光18 小时前
【Git】命令大全:从入门到高手,100 个最常用命令速查(2026 版)
java·大数据·人工智能·git·python·elasticsearch·设计模式
Snooker_1461 天前
TRAE、VSCode上进行git管理
ide·git·vscode