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

相关推荐
蹊黎14 分钟前
Git 从入门到精通(二):创建本地仓库与三大核心区域
git
蹊黎2 小时前
Git 从入门到精通(一):初识 Git 与环境搭建
git
゛凌乱的记忆づ21 小时前
好用的md文件编辑器——TyporaS与Typora
笔记·git·typora·markdown
এ慕ོ冬℘゜1 天前
Git 基础规范:小步提交、提交信息规范与常用命令
git·svn
忘了ʷºᵇₐ1 天前
Git学习笔记
笔记·git·学习
BIBI20492 天前
换 Git 托管平台怎么做?基于 TortoiseGit 的跨平台迁移教程
windows·git·tortoisegit·问题解决·版本控制·最佳实践
echome8882 天前
Git 日常救急:撤销提交、找回误删文件和解决冲突
git·版本控制
赵民勇2 天前
Git命令详解
git
不老刘3 天前
Antigravity 的 New Worktree 模式:给 AI 代理一个安全的“平行工位”
人工智能·git·ai编程·antigravity
光谱SpectrAI3 天前
Windows 也中招:Git Bash 和 Node 仍信任泄露的 eMudhra 证书
git