Interactive RebaseRewrites a series of commits with actions: pick (use as-is), squash (combine with previous), reword (edit message), edit (amend), or drop (delete).
SquashCombines a commit with the one before it. Useful for merging "fix typo" commits into the feature commit they fix.
Rewriting HistoryInteractive rebase creates NEW commits with new hashes. The old commits still exist but are no longer referenced. Only rebase commits you haven't pushed.
View the commit history
Notice there are 4 commits. The "Fix typo in A" commit could be squashed into "Add feature A" to keep history clean.
● View the commit history
○ Rebase interactively onto the initial commit (ia1b2c3)
○ Verify the rebased history
Terminal
📘 Starting tutorial: Interactive Rebase
Use git rebase -i to rewrite commit history interactively