Interactive Rebasing, Squashing & Commit Rewriting
Squash dirty intermediate commits (pick, squash, reword, drop), maintain linear commit histories, and obey the Golden Rule of Rebasing.
Rebase vs Merge & Golden Rule of Rebasing
### Rebase vs Merge
- **`git merge`**: Preserves complete historic branch topology, adding a merge commit.
- **`git rebase`**: Replays feature commits on top of target branch, creating a linear history.
> ⚠️ **The Golden Rule of Rebasing**: NEVER rebase branches that have already been pushed and shared with other developers on remote repositories.