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

相关推荐
ficker131 天前
git常用命令
git
kevin_cat1 天前
微信群机器人-备份文件发送通知
git·bash·企业微信
程序媛Dev1 天前
50.4k Star!我用这个神器,在五分钟内搭建了一个私有 Git 服务器!
运维·服务器·git
澈轩1 天前
Git 用得好,下班走得早
git
人间造梦工厂1 天前
Git Bash 别名
git
画个太阳作晴天2 天前
解决 Android Studio 中 build 目录已被 Git 跟踪后的忽略问题
git
wjs0402 天前
Git常用的命令
java·git·gitlab
原野风霜3242 天前
Git使用总结
git
青草地溪水旁2 天前
Git Bash 中 Git 命令的实用主义指南
git·bash
至善迎风2 天前
版本管理系统与平台(权威资料核对、深入解析、行业选型与国产平台补充)
git·gitee·gitlab·github·svm