What is a 'Squash and Merge' and why would a team choose it?

Last updated 6 July 2026

  • Squash and merge collapses all of a feature branch's commits into one new commit on the target branch (git merge --squash). It has no second parent, so it isn't a true merge commit.

  • Teams choose it for a clean mainline: one atomic commit per PR, no WIP noise, easy bisecting and single-commit reverts.

  • Trade-offs: it loses granular history and per-commit authorship. The branch also isn't recorded as merged, which complicates later merges from it.

  • https://www.reddit.com/r/cscareerquestions/comments/bxxwfc/what_are_some_behavioral_questions_you_have_been/
  • https://www.reddit.com/r/rails/comments/1shfrbq/3_years_rails_dev_but_failed_basic_interview/
  • https://www.reddit.com/r/cscareerquestions/comments/u7z2xh/how_often_do_developers_look_at_git_trees/
All Git interview questions