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

相关推荐
吴声子夜歌13 小时前
TypeScript——泛型
前端·git·typescript
春日见14 小时前
3三分彻底了解Git Graph极其应用
git
风.foxwho16 小时前
jenkins使用 ED25519密钥 拉取Git 代码 配置
git·servlet·jenkins
ruanCat17 小时前
前端工程化工具链从零配置:simple-git-hooks + lint-staged + commitlint
前端·git·代码规范
木子小喵18 小时前
Git的使用介绍!超通俗!
git
coderYYY18 小时前
git push报错Authentication failed for ‘xxx’也不会弹要求输入用户名密码的最终解决方法
前端·git·gitee·github
@PHARAOH19 小时前
WHAT - git worktree 开发的并发模型
大数据·git·elasticsearch
苦瓜小生20 小时前
【Git】| 将拉下来的代码上传到自己的 Gitee 仓库(手把手教学)
git·gitee
WKP941820 小时前
git的merge和rebase操作
git
___波子 Pro Max.1 天前
Git 分支切换
git