美文网首页
git多条commit提交合并成一条

git多条commit提交合并成一条

作者: 小猪x | 来源:发表于2023-11-06 11:57 被阅读0次

注意

\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

相关文章

网友评论

      本文标题:git多条commit提交合并成一条

      本文链接:https://www.haomeiwen.com/subject/plotwdtx.html