转自:

https://blog.csdn.net/themagickeyjianan/article/details/80333645

改进版本:合并多个提交为一条(git merge --squash branchname)

但是,操作方便并不意味着这样操作就是合理的,在某些情况下,我们应该优先选择使用--squash选项,如下:

$ git merge --squash anotherbranch
$ git commit -m "squash merge description"
05-11 22:02