Git cherry-pick

Git cherry-pick

cherry-pick command helps in migrating commits from one branch to another branch .coomon uses of cherry-picking is to rearrage the order of commits in a sustainable manner .the main important thing is order of commits before using cherry-pick .this creates new commit with different commit id after the current commit (HEAD)


git cherry-pick <Commit1> <Commit2> <...>

here, first commit1 will be processed next commit2 .the order will be left to right ,starting to ending.

Single commit from other branch

git cherry-pick <commit id>

CHERRY-PICK but don’t commit

git cherry-pick -n <commit id>

Force commit from same branch

git cherry-pick --ff <commit id>
Last updated on by vishal devxo