Commit Squashing

Noun · Hacker Culture

Definitions

  1. Combining several commits into one before merging, so the permanent history records a single coherent change rather than the messy sequence that produced it. In Git this is done with interactive rebase or a squash-merge, and it converts a branch containing 'wip', 'fix typo', and 'actually fix it' into one commit with a considered message. The benefit is a readable main-branch history in which each commit is a self-contained, revertible, bisectable unit; the cost is losing the fine-grained record of how the work evolved, which can matter when debugging why an intermediate decision was made. Because squashing rewrites history it must not be applied to commits others have already based work on. Teams generally standardise on squash-merge, merge commits, or rebase rather than mixing them.

    In plain English: Merging several commits together into a cleaner single commit.

    Example: "They prefer commit squashing so each PR lands as one coherent change."

Related Terms