cherry-pick
Copying the change made by one existing commit onto the current branch as a new commit.
In more detail
git cherry-pick 2b3c4d5 applies that commit's diff here and records it with the same message and author but a new ID. It takes only that one commit, not the history before it, which suits moving a single fix between branches. It works best when the commit holds one idea.
Example
git cherry-pick 2b3c4d5Related terms
- commit — A saved snapshot of the whole project in Git, together with its author, committer, time, message and a pointer to the commit before it.
- rebase — Moving a series of commits so they start from a different commit, by replaying each one as a new commit with a new ID.
- merge — Combining the work of two branches into one, either by moving a branch forward (a fast-forward) or by recording a merge commit.
Taught in
- Committing, And What A Good Message Says — Advanced Git Internals & Distributed Workflows
- Cherry Picking, Reflog, And Getting Work Back — Advanced Git Internals & Distributed Workflows