Git Cherry-pick
git cherry-pick takes one commit from somewhere else, often another branch, and applies the same change to your current branch as a new commit.
Use it when you need one fix from a branch, but not the rest of the branch.
Pick a commit from the hotfix branch
git log --oneline -1 hotfix
df31edb Add README
git cherry-pick df31edb
[main d3c2af2] Add README
Date: Thu Nov 5 10:58:35 2026 +0100
1 file changed, 1 insertion(+)
create mode 100644 README.md
git log --oneline
d3c2af2 Add README
99f8584 Add docs line
c2ddb8a Add welcome line
21e6719 First release of Hello World!
Note
The copy gets a new hash (d3c2af2), because it has a different parent than the original (df31edb).
If the change does not apply cleanly, fix the conflict, git add the file and run git cherry-pick --continue, or cancel with git cherry-pick --abort.