另一种方法是使用squash
- 其他工作interactive rebase
为了做一个git squash,请按照以下步骤操作:
# X is the number of commits you wish to squash, in your case 7
# In this interactive rebase there can be more that 7 commits if
# there was a merge in one of them
git rebase -i HEAD~X
一旦你压缩你的提交 - 选择s
进行squash =它会将所有提交合并为一个提交。