Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git cherry-pick multiple commits [duplicate]

Tags:

git

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?

like image 989
BJ Dela Cruz Avatar asked Nov 16 '12 18:11

BJ Dela Cruz


People also ask

Does cherry pick duplicate commits?

Failure to this, cherry-picking can cause duplicate commits and users are encouraged to use git merge in scenarios where it is risky. PS: The branch you cherry-pick from should be deleted, cherry-pick the commits into two or more different branches then delete the faulty branch to avoid code duplication.

What is cherry pick multiple commits?

Cherry-pick multiple Git commits Since Git 1.7. 2, you can cherry-pick a range of commits by using the dot notation. Note that using this command, the commit A will NOT be included into the cherry-pick. For example, back to the “master” branch, let's try to cherry-pick two commits into the feature branch.


1 Answers

git cherry-pick $from_sha..$to_sha

like image 56
Oleksandr Kravchuk Avatar answered Oct 09 '22 11:10

Oleksandr Kravchuk