git cherry-pick multiple commits

git
12,547

git cherry-pick $from_sha..$to_sha

Share:
12,547

Related videos on Youtube

BJ Dela Cruz
Author by

BJ Dela Cruz

I am a software developer and cybersecurity professional with 8+ years of industry experience. My main interests are mobile and web development, cloud computing, and cybersecurity.

Updated on September 15, 2022

Comments

  • BJ Dela Cruz
    BJ Dela Cruz 3 months

    Possible Duplicate:
    How to cherry pick a range of commits and merge into another branch

    I want to cherry-pick 19 commits from one branch and apply them to another branch. All of the commits are sequential (commit 1, commit 2 ... commit 19), and the last commit is not the most recent commit (i.e. there are other commits that come after it whose changes I don't want to apply). How can I apply my changes to a branch without typing git cherry-pick for each commit?

  • g19fanatic
    g19fanatic about 10 years
    definitely the proper way of doing this :)
  • Uri
    Uri almost 10 years
    Could you do git cherry-pick HEAD..branch-name?
  • PDK
    PDK over 4 years
    NB. ^ (stackoverflow.com/a/1994491/3419541) …if you want to pick the range hash1 through hash19 (inclusive) that would be hash1^..hash19—not hash1..hash19.
  • 0andriy
    0andriy over 3 years
    Don't remember from which version, but git cherry-pick -<NUM_OF_COMMITS> <HASH_OF_LAST_COMMIT> works as a charm!