git多条commit提交合并成一条

2023-11-06  本文已影响0人  小猪x

注意

\color{red} {合并失败回滚方法}
git rebase --abort

正文

如何把第2~6次提交合并成一次提交


image.png

1、选中需要合并的提交,选择 【Squash Commits】


image.png

2、会将选中的几次提交 message 合并在一起,重新编辑提交的message


image.png

git log 查看更改后的提交记录


image.png

然后执行 git push -f 覆盖远端即可。在远端查看符合预期

image.png

git代码合并


image.png
上一篇 下一篇

猜你喜欢

热点阅读