Skip to content
Latchkey

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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →