Git merge vs rebase.
Stitching two histories together with a join, versus replaying your changes on top to make one tidy line.
- Both roads have grown.1
Your branch and main have both moved on. Now you need to combine them.
- Junction added. History honest.2
A merge ties them with one new junction commit — the true forks and joins kept intact.
- 3
Nothing is rewritten, but on a busy project the map turns into crisscrossing lines.
- Pick them up, lay them down again.4
A rebase lifts your commits off and replays them on top of the latest main, one by one.
- 5
The result is one clean, straight line — easy to read and to bisect for a bug.
- Rebase yours, not the shared ones.6
But replay makes new commits. Never rebase ones you’ve already shared — the team still holds the originals.
Semicolony semicolony.dev/eli5/git-merge-vs-rebase/comic