git cherry pick多个patch合并成一个提交

比如合并两个cherry pick的patch

1. git cherry pick patch 1

2. git cherry pick patch 2

3. git rebase -i HEAD~2 会显示pick信息,例如

pick 01d1124 Adding license
pick 6340aaa Moving license into its own file

4. 修改成如下所示:

pick 01d1124 Adding license
squash 6340aaa Moving license into its own file

5. git log

详情可参考: http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html



猜你喜欢

转载自blog.csdn.net/dengxiafubi/article/details/80548441
今日推荐