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

相关推荐
洛小豆1 小时前
Git打标签仓库看不到?她说:豆子,你又忘了加 --tags!
git·后端·github
好奇的菜鸟4 小时前
理解 Git 命令 `git reset --hard origin/pre`:版本回退的“利刃”与使用禁忌
大数据·git
春生野草4 小时前
git的使用
git
今天头发还在吗4 小时前
解决 Git 推送冲突:使用 Rebase 整合远程更改
大数据·git·elasticsearch
蓝色空白的博客6 小时前
Git代码下拉更新推送操作用法整理
git
风也温柔☆8 小时前
IDEA/WebStorm 切换分支(超简单)
git·intellij-idea·webstorm·切换分支·checkout
Jammingpro19 小时前
【Git版本控制】Git初识、安装、仓库初始化与仓库配置(含git init、git config与配置无法取消问题)
java·git·elasticsearch
shark1 天前
无需放弃变更、关闭占用程序!用暂存区和 git底层命令实现 Git 变更备份
git·shell·自动化运维
_poplar_1 天前
15 【C++11 新特性】统一的列表初始化和变量类型推导
开发语言·数据结构·c++·git·算法
北城笑笑1 天前
Git 10 ,使用 SSH 提升 Git 操作速度实践指南( Git 拉取推送响应慢 )
前端·git·ssh