Git 1.7.2 introduced the ability to cherry pick a range of commits. From the release notes:
git cherry-picklearned to pick a range of commits
(e.g.cherry-pick A..Bandcherry-pick --stdin), so didgit revert; these do not support the nicer sequencing controlrebase [-i]has, though.
To cherry-pick all the commits from commit A to commit B (where A is older than B), run:
git cherry-pick A^..B
If you want to ignore A itself, run:
git cherry-pick A..B
Notes from comments:
Ashould be older thanB, orAshould be from another branch.- On Windows, it should be
A^^..Bas the caret needs to be escaped, or it should be"A^..B"(double quotes). - In
zshshell, it should be'A^..B'(single quotes) as the caret is a special character. - For an exposition, see the answer by Gabriel Staples.
(Credits to damian, J. B. Rainsberger, sschaef, Neptilo, Pete and TMin in the comments.)