What Is a Squash Merge?
A squash merge collapses all the commits in a pull request into one commit when merging into the target branch. The messy work-in-progress history of the branch becomes a single, clean entry on main. It is a popular merge strategy for keeping the main branch history readable, one commit per merged change.
Why it matters
Feature branches often accumulate noisy commits like "fix typo" or "address review." Squash merging hides that detail behind one coherent commit, making main easy to scan and revert. The trade-off is losing the granular intermediate history of how the change evolved.
Related concepts
- One commit per PR on the target branch
- Easier to revert a whole change at once
- Loses intermediate commit granularity
Related guides
What Is a Git Rebase?A git rebase replays your commits on top of another branch, producing a linear history instead of a merge com…
What Is a Merge Queue?A merge queue serializes pull-request merges, testing each against the latest main, so the branch stays green…
What Is a Feature Branch?A feature branch is a short-lived branch where a single feature or fix is developed in isolation before mergi…