1. git merge --squash
实例:dev分支merge master分支(git merge master)
git merge master 后的git log
commit 5 merge
commit 4 master
commit 3 master
commit 2 dev
commit 1 dev
git merge master --squash 后的git log
commit 3 squash(包括commit3、4,并且不显示commit5)
commit 2 dev
commit 1 de
2. git format-patch 将多个commit生成一个patch
git format-patch 貌似只可以将一次提交作为一个patch
git format-patch -2 03865244#某次提交之前的几次
http://www.jianshu.com/p/300eea8b66cc
通过reset 和merge来将多个commit 合并为一个patch
http://blog.csdn.net/xsckernel/article/details/17718127