Merge vs rebase vs cherry-pick?
Understand the concept
Merge, rebase and cherry-pick integrate changes through different history operations. Merge combines histories, rebase recreates commits on a new base, and cherry-pick recreates selected changes on the current branch. Recreated commits receive new IDs, which matters when other people already depend on the old history.
Important ideas
-
Merge combines branch histories without rewriting existing commits.
-
Rebase replays commits on a new base and changes their IDs.
-
Cherry-pick applies one selected commit; avoid rebasing shared history without coordination.
-
A linear history can be useful, but shared-branch coordination matters more than a visually tidy commit graph.
Can you explain it without the notes?
Merge vs rebase vs cherry-pick?
Use your own words. Explain an example and one limitation before checking the explanation.
Check your explanation
Merge, rebase and cherry-pick integrate changes through different history operations. Merge combines histories, rebase recreates commits on a new base, and cherry-pick recreates selected changes on the current branch. Recreated commits receive new IDs, which matters when other people already depend on the old history.
Turn this concept into a clear answer.
- Explain when preserving history is important and why rewriting shared commits can disrupt collaborators.
Adapted from 09_TESTING_GIT_DOCKER_CLOUD.md · “Merge vs rebase vs cherry-pick?”. Examples are study fragments; framework behavior can depend on your version.