0

我有一组补丁,例如如下。

0001-first-commit.patch
0002-second-commit.patch
0003-third-commit.patch
0004-4th-commit.patch
0005-fifth-commit.patch

从给定的补丁号到最后应用补丁的最佳方法是什么。我的意思是我们可以在使用git am应用补丁时指定“范围”吗?

例如,我想应用从 0003 到 0005 的补丁。我应该使用git am的什么标志?还有其他方法吗?

4

1 回答 1

1

要将 0003 应用于 0005,

git am 000[3-5]*.patch

要跳过 0001 和 0004,

git am 000[!14]*.patch

对于更复杂的情况,您可能需要一个像循环这样的小脚本。

于 2019-05-21T07:18:11.913 回答