Run interactive rebase from the start of the repository.
Section: Common Rebase Workflows
Rewrite history from the root commit
bash
bash
git rebase -i --rootExplanation
Useful for cleaning very early history or splitting an initial commit in private repositories.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Common Rebase Workflows
Rebase current branch onto main
Replay your branch on top of the latest main.
Fetch and rebase instead of merge
Update your current branch with a linear pull strategy.
Rebase with autostash
Temporarily stash dirty worktree changes before rebasing.