从特定提交创建git修补程序

从特定提交创建git修补程序,git,format-patch,Git,Format Patch,假设您在分支A上有提交: 1 2 3X 4 5X 6 7 您希望从提交1,2,4,6创建修补程序。我认为可以使用3个补丁: git format-patch -2 3X --stdout > first.patch git format-patch -1 5X --stdout > second.patch git format-patch -1 7 --stdout > third.patch 但是否可以使用单个补丁?特别是这个答案:是的,非常相似,但我不希望提交的3X

假设您在分支A上有提交:

1
2
3X
4
5X
6
7
您希望从提交1,2,4,6创建修补程序。我认为可以使用3个补丁:

git format-patch -2 3X --stdout > first.patch
git format-patch -1 5X --stdout > second.patch
git format-patch -1 7  --stdout > third.patch

但是否可以使用单个补丁?

特别是这个答案:是的,非常相似,但我不希望提交的3X和5X位于单个补丁中,你说得对;这是不同的。我撤回了我的投票。我不知道。。。除了
cat first.patch second.patch third.patch>one.patch之外
如果3X和5X提交仅在不同于1,2,4,6的文件上,则可以提取更改的文件名,并仅区分它们。