git cherry-pick applies the changes from a specific commit onto the current branch, creating a new commit with the same changes. It is the surgical tool for porting a bug fix from one branch to another without merging the entire branch history.
GitCherry-PickVersion ControlCLIgit cherry-pick abc1234
abc1234 to the current branch and creates a new commit. The new commit has a different SHA but the same code changes and commit message. Use git log --oneline to find the commit SHA.git cherry-pick --no-commit abc1234
git cherry-pick --edit abc1234
git cherry-pick feature-branch
git cherry-pick abc1234^..def5678
abc1234 (inclusive, due to ^) through def5678. Without the ^, the range starts after abc1234 (exclusive). All commits in the range are applied in order.git cherry-pick abc1234 def5678 ghi9012
# 1. Edit conflicting files to resolve git add resolved-file.txt git cherry-pick --continue
git cherry-pick --abort
git cherry-pick --skip
--skip discards the current conflicting commit and moves on to the next one. Use this when a specific commit in the range is not relevant to the target branch and can be safely omitted.git log --oneline branch-name.git checkout target-branch.git cherry-pick SHA to apply the commit.git add and git cherry-pick --continue.Use cherry-pick when you only need specific commits from another branch, not the entire branch history. Common use cases: backporting a bug fix to an older release branch, moving a single feature commit to a different branch, or recovering a specific commit that was accidentally left off a release.
No — cherry-pick creates a new commit on the current branch with the same changes as the original. The original commit on its branch is unchanged. The new commit gets a different SHA because it has a different parent commit and potentially a different timestamp.
Cherry-pick applies specific individual commits you choose. Rebase replays a whole series of commits onto a new base. Use cherry-pick for surgical, targeted commit copying. Use rebase when you want to update an entire feature branch to include recent changes from main.