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

相关推荐
xiAo_Ju3 小时前
git hooks配置
git
mit6.8244 小时前
[Git] 如何拉取 GitHub 仓库的特定子目录
git·github
许心月6 小时前
Git#revert
git
军军3609 小时前
Git大型仓库的局部开发:分步克隆 + 指定目录拉取
前端·git
间彧10 小时前
Git命令速查表
git
用户25191624271112 小时前
Git原理分析
前端·javascript·git
lsp-0713 小时前
Git版本控制与协作
git
百思可瑞教育1 天前
Git 对象存储:理解底层原理,实现高效排错与存储优化
大数据·git·elasticsearch·搜索引擎
Bitup_bitwin1 天前
Git智能合并机制深度解析
git
TeleostNaCl1 天前
OpenWrt 编译 | 一种使用 git submodule 方式实现一键更新多个外部软件包
网络·经验分享·git·智能路由器