What is it?
Choosing a commit from one branch and apply it to another. without merging all the changes.
How to do that?
first, checkout to the destination branch
1 2 3 4 5 | git checkout destination-branch |
then find the commit hash you want to use and add use the following code to apply that into the current branch:
1 2 3 4 5 | git cherry-pick commit-hash |
what about multi commit?
In case of the multi commit, it’s better to create a new branch of the destination branch and git cherry-pick all the commits into that branch, and after testing it, merge the branch to the final branch.