Skip to content

Scenario library

Start here

Each scenario is a script of commands, not a snapshot — it replays when you open it, so what you see cannot disagree with what the commands actually do. Every one stops just before the interesting command and names it.

  • A feature branch left behind main

    feature-behind-main

    The commonest shape. After the rebase, watch every feature commit change its hash — not because the content changed, but because the parent did, and the parent is part of the hash.

    Then try rebase main Two feature commits will be written as new objects; the old ones stay on the shelf, faded.

    Open in the sandbox
  • A messy history to tidy up

    messy-history

    Three small commits that ought to be one. Interactive rebase folds them together — producing new objects rather than altering the old ones.

    Then try open the interactive rebase panel Set the three steps to pick + squash + squash.

    Open in the sandbox
  • A branch other people already have

    published-branch

    Here rebase is the wrong tool. Commits other people already hold must not be rewritten — use revert, which adds to the history instead of changing it.

    Then try revert HEAD~1 Compare it with `reset --hard HEAD~2`: one is safe for collaborators, the other is not.

    Open in the sandbox
  • An accidental reset --hard

    accidental-hard-reset

    The situation that causes panic. The commit went nowhere: it is still in the store, still named by the reflog, and one command brings it back.

    Then try reset --hard HEAD@{1} Look at the reflog panel: the “lost” commit is right there, faded but whole.

    Open in the sandbox
  • Rebasing a branch you already pushed

    force-push-danger

    This branch is already on origin. The rebase rewrites its commits, so the next push is rejected — and forcing it leaves the old commit on origin named by nothing. A colleague who already fetched still has it; anyone cloning today never will.

    Then try push origin main It will be rejected, and the message names which commit would be stranded. Compare with `push origin main --force`, then look at the origin panel.

    Open in the sandbox
  • A rebase that conflicts

    conflicting-rebase

    Two branches changed the same line. The rebase stops part-way without moving a ref or writing an object — and your resolution is what decides the resulting commit hash.

    Then try rebase main Resolve it in the working-tree panel, `add konfig.txt`, then `rebase --continue`.

    Open in the sandbox