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

  • 7
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值