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

相关推荐
嘻嘻仙人3 天前
Ubuntu中 git上传自己的项目和二次上传一般流程
git·github
Patrick_Wilson3 天前
Squash Merge 的血缘陷阱:为什么删掉的代码又活了过来
前端·git·程序员
沉浸学习的匿名网友3 天前
什么是 .gitignore?为什么每个 Git 项目几乎都离不开它?
前端·git
深海鱼在掘金4 天前
Git 完全指南 —— 第3章:理解工作区、暂存区、版本库三个核心
git
江华森4 天前
Git 基础筑基:从原理到团队协作的全栈实战
git
JakeJiang4 天前
Git 必备命令指南:从日常高频到项目开发实战
git
叫我少年5 天前
Windows 中安装 git
git
深海鱼在掘金10 天前
Git 完全指南 —— 第1章:Git 概览与版本控制演进
git
noravinsc11 天前
关于Git Flow
git
蜜獾云11 天前
在Git中配置用户名和密码
git