0

I would like to merge into my branch only a specific list of commits [A, C, E].

The solution I often see would be to do git cherry-pick A^..E but it would also commit Band D that I don't want. Is there a way to specify the exact list of commits I want ?

Arcyno
  • 4,153
  • 3
  • 34
  • 52
  • Does this answer your question? [How to cherry-pick multiple commits](https://stackoverflow.com/questions/1670970/how-to-cherry-pick-multiple-commits) specifically [this answer](https://stackoverflow.com/a/47767118/989920) – evolutionxbox Mar 10 '21 at 10:59
  • 6
    Just `git cherry-pick A C E` – How about nope Mar 10 '21 at 11:01

1 Answers1

0

A little bit more descriptive alternative to cherry-pick is git rebase -i BRANCH_TO_REBASE which gives you the possibility to select interactively a specific list of commits.

Dominik Kern
  • 146
  • 8
  • Although this is true (and I also often use it for this purpose) you can't always cherry-pick through a rebase (especially between far away branches) – rubenvb Mar 10 '21 at 12:41