A rebase takes your commits and moves them on top of another branch, creating a cleaner history.
Imagine:
main:
A---B---C
feature:
D---E
After rebasing:
main:
A---B---C---D---E
Your feature looks like it was created from the latest version of main.
Teams use it:
- To maintain cleaner commit history.
- For easier code reviews.
- Fewer unnecessary merge commits.
📌 The rule: Rebase your local work. You have to be careful rebasing commits that other people already use.
