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

相关推荐
典学长编程24 分钟前
高效学习之一篇搞定分布式管理系统Git !
大数据·git·搜索引擎
是2的10次方啊1 小时前
.gitignore失效自救指南:原理揭秘与工程师实战排查全流程
git
海外空间恒创科技1 小时前
香港站群服务器与普通香港服务器对比
服务器·git·github
Wetoria3 小时前
管理 git 分支时,用 merge 还是 rebase?
前端·git
泰勒朗斯18 小时前
如何在新机器上设置github完成内容git push
git·github
小妖6661 天前
git branch -a 还有一些已经删除了的分支
git
&Sinnt&2 天前
Git 版本控制完全指南:从入门到精通
git·后端
Tiny2142 天前
多人协同开发时Git使用命令
git
WebGirl2 天前
代码Revert后再次Merge会丢失的问题
git
小皮侠2 天前
nginx的使用
java·运维·服务器·前端·git·nginx·github