Interactive Git Rebase Simulator

Master Git Rebase with this interactive simulator. Visualize commits, branches, and the rebase process in real-time. Understand how rebase rewrites history. Read the complete guide.

Commit History

c1

Controls

Current Branch: main

Command History

$ git init

How to Use

This simulator allows you to practice the `git rebase` command visually.

  1. Create Commits: Use the "Add Commit" button to create new commits on the current branch.
  2. Create Branches: Create new branches to simulate a divergent history.
  3. Checkout: Click on a branch name to switch to it (checkout).
  4. Rebase: While on a feature branch, click "Execute Rebase" to rebase it onto another branch (e.g., main).
  5. Visualize: Watch how commits are moved and history is rewritten.
  6. Reset: Use "Reset" to start over.

Common Questions

What happens to the original commits?

In a rebase, original commits are not "moved" literally; new commits are created with the same content but different hashes and parents, applied on top of the target base. The old commits are eventually garbage collected if no longer referenced.

Share this tool