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

相关推荐
purpleseashell_Lili5 小时前
commitizen,cz-git,husky 三者区别
git
摇滚侠6 小时前
零基础小白自学 Git_Github 教程,解决分支合并冲突,笔记14
笔记·git·github
我是李武涯9 小时前
如何修改git的commit消息
git
fruge9 小时前
Git 进阶技巧:分支管理、冲突解决、提交规范实操
大数据·git·elasticsearch
spencer_tseng10 小时前
Git-2.18.0-64-bit.exe client install
git
摇滚侠12 小时前
Idea Git 合并分支,rebase 和 merge 的区别,应该使用哪个,多人协作开发,禁止使用 rebase 合并分支
git·github
winfreedoms12 小时前
将 Git 恢复到「上一次提交(git commit)的版本」操作
git
系夏普12 小时前
Git 的三大工作区域:工作区、暂存区、本地仓库
git
摇滚侠14 小时前
零基础小白自学 Git_Github 教程,分支合并,笔记13
笔记·git·github
young14 小时前
Git分支回退到指定提交点
git