Cherry-pick
// Definition
Applying a single specific commit from one branch onto another, by its hash — without merging the whole branch. Used to pull one fix into a release branch, or grab a colleague's commit without their other work. `git cherry-pick <hash>` copies just that change.
// Why it matters
Cherry-pick is how a critical fix (or a test) gets hotfixed into a release branch without dragging along everything else on main. QA cares because it's common in release management — and because a cherry-picked commit is a copy (new hash), which can cause confusion or duplicate-change conflicts if the branches later merge.
// How to test
git log main --oneline # find the fix's hash git switch release/2.4 git cherry-pick a1b2c3d # apply just that commit to the release branch # note: creates a NEW commit (different hash) — the change now exists twice
// Common mistakes
- Cherry-picking a commit that depends on earlier commits not present on the target (breaks)
- Forgetting the picked commit is a copy → duplicate-change conflicts on later merge
- Using cherry-pick where a proper merge/backport process was needed
// Related terms
Commit
A saved snapshot of changes in a Git repo, with a message describing what changed and a unique hash identifying it. Commits are the atomic unit of history — each one is a revertible, reviewable point you can return to. Good commits are small and focused; the message explains why, not just what.
Branch
An independent line of development in a Git repository — a movable pointer to a commit, letting you work on a feature or fix in isolation without touching the main line. Branches are cheap and disposable; the typical flow is branch off `main`, commit work, open a pull request, merge back.
Rebase
Replaying your branch's commits on top of another branch's latest state, producing a linear history instead of a merge commit. `git rebase main` makes your feature branch look as if you started it from the current `main`. Powerful for a clean history, dangerous if used on shared branches — it rewrites commit hashes.