Squash
ELI5 — The Vibe Check
Squash is like combining multiple save points into one. Instead of having 15 tiny commits like 'fix typo', 'oops forgot file', 'actually fix it', you squash them all into one clean commit that says 'Add login feature'. Much cleaner history!
Real Talk
Squashing combines multiple commits into a single commit. This is typically done during an interactive rebase or when merging a PR. It results in a cleaner, more readable commit history.
Show Me The Code
git rebase -i HEAD~5
# Mark commits as 'squash' or 's' in the editor
# Or squash merge a PR:
git merge --squash feature-branch
When You'll Hear This
"Squash your commits before merging." / "Use squash merge for cleaner history."
Related Terms
Commit
A commit is like pressing the save button in a video game.
Merge
Merge is like combining two parallel universes back into one. You take the changes from your branch and smoosh them into another branch.
Pull Request (PR)
A pull request is like raising your hand in class and saying 'Hey, I made some changes — can someone check my work before we make it official?
Rebase
Rebase is like rewriting history.