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

相关推荐
南山nash4 小时前
git从入门到熟练
git
夜流冰6 小时前
Git - GitForWindows
git
一个很帅的帅哥7 小时前
部署chat-vue
大数据·git·elasticsearch
芒鸽7 小时前
鸿蒙PC使用ffmpeg+electron实现视频中音频的提取
git
SunkingYang8 小时前
使用TortoiseGit工具推送(push)时,忘了先拉取(Pull),提示冲突,后续怎么处理冲突?
git·tortoisegit·pull·push·推送·冲突·拉取
BestOrNothing_20159 小时前
Git 团队开发冲突合并全流程:本地是否改动 + 远端是否更新,如何正确同步并合并(同分支/不同分支下的几种场景)
git·分支管理·git pull·git merge·分支冲突·git协作·git fetch
zzlyyds9 小时前
工作的时候遇到的git版本冲突与合并问题
git
BestOrNothing_20159 小时前
Git fetch 详解:git fetch 和 git fetch origin 到底有什么区别?(origin/xxx、远端跟踪分支一次讲透)
git·分支管理·开发规范·新手教程·fetch / origin·本地/远程 分支·detached head
gsls2008089 小时前
服务器状态监控Uptime Kuma
运维·服务器·git
XiaoHu020710 小时前
Linux进程间通信
linux·运维·服务器·c++·git·vscode