git rebase解决合并冲突
记录合并冲突解决方法,使用的
git rebase
,感觉很好用1.git rebase 文档
https://git-scm.com/docs/git-rebase
2.简易步骤
1)假如需要解决当前分支与dev分支的冲突
使用
git rebase dev
若有冲突,会有相关位置指示,截图中没覆盖到。。。

1.png

2.png
2)查看代码,会发现冲突位置已经标明(灰色提示是vscode提供的)

3.png
3)解决冲突后,执行
git add .
git rebase --continue

4.png
4)如果还处于rebase状态,则继续解决冲突
没有则直接push
解决文件中冲突的的部分
打开冲突的文件
Updated upstream 和=====之间的内容就是pull下来的内容
====和stashed changes之间的内容就是本地修改的内容
这种情况,git也不知道哪行内容是需要的,所以要自行确定需要的内容
直接编辑冲突了的文件(test.txt),把冲突标记删掉,把冲突解决正确
eg:
保留bb=2
保存退出