Back to lessons

Rebasing & History Rewriting

Clean up your commit history with interactive rebasing.

Step 1 of 714%

Rebasing rewrites commit history by moving or combining commits. Use it to maintain a clean, linear project history.

The key difference between merging and rebasing is how they handle history. Merging creates a new commit that ties two branches together, preserving exactly what happened. Rebasing rewrites history by replaying your commits on top of another branch, creating a perfectly linear story. Many teams prefer rebasing for feature branches because it keeps the main branch history clean and easy to follow.
1 / 7