I have BranchA which is 113 commits ahead of BranchB.
BranchA
BranchB
But I only want the last 10 or so commits from BranchA merged into BranchB.
Is there a way to do this?
The git cherry-pick <commit> command allows you to take a single commit (from whatever branch) and, essentially, rebase it in your working branch.
git cherry-pick <commit>
Chapter 5 of the Pro Git book explains it better than I can, complete with diagrams and such. (The chapter on Rebasing is also good reading.)
Lastly, there are some good comments on the cherry-picking vs merging vs rebasing in another SO question.
2.1m questions
2.1m answers
60 comments
57.0k users