36

I am having around 100 patches like below,is there a way to apply all of them in one shot?

0001-*.patch,0002-*.patch,0003-*.patch............
323go
  • 14,143
  • 6
  • 33
  • 41

3 Answers3

45

You can use git am, for example

$ git am *.patch

For all available options, checkout the man page.

amaechler
  • 845
  • 9
  • 18
9

To get one commit for all patches:

git apply *.patch
git add -A
git commit -m '<your message>'

Patches are applied in the order of the directory listing.

git apply has most of the flags of git am

2

On Windows/cmd git apply does not recognize *. However some parts of cmd understand it, I use below workaround:

> for /r %i in (patch_dir\*.patch) do git apply %i

Varun Garg
  • 2,464
  • 23
  • 37