Semicolony ELI5 · comic

Git merge vs rebase.

Stitching two histories together with a join, versus replaying your changes on top to make one tidy line.

  1. Both roads have grown.
    your branch main
    1

    Your branch and main have both moved on. Now you need to combine them.

  2. Junction added. History honest.
    merge commit
    2

    A merge ties them with one new junction commit — the true forks and joins kept intact.

  3. honest, but a tangle
    3

    Nothing is rewritten, but on a busy project the map turns into crisscrossing lines.

  4. Pick them up, lay them down again.
    replayed on top
    4

    A rebase lifts your commits off and replays them on top of the latest main, one by one.

  5. clean, linear, easy to read
    5

    The result is one clean, straight line — easy to read and to bisect for a bug.

  6. Rebase yours, not the shared ones.
    yours: rebase ok shared: never
    6

    But replay makes new commits. Never rebase ones you’ve already shared — the team still holds the originals.

Join two roads with a junction, versus re-laying your road to continue straight from the new start.
Semicolony semicolony.dev/eli5/git-merge-vs-rebase/comic
← All ELI5 explainers