0

I have set of patches, for e.g as below.

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

What is the best way to apply patches from given patch number up to end. I mean can we specify 'range' while applying patch using git am?

For example, I want to apply patch from 0003 up to 0005. What flag with git am should I use? Is there any other method?

SD.
  • 1,212
  • 15
  • 32

1 Answers1

1

To apply 0003 to 0005,

git am 000[3-5]*.patch

To skip 0001 and 0004,

git am 000[!14]*.patch

For more complicated situations, you may need a small script like a loop.

ElpieKay
  • 19,185
  • 5
  • 22
  • 36