Squash Merge とは?
squash merge は、ターゲット branch に merge する際に、pull request 内のすべての commit を 1 つの commit につぶします。branch の雑然とした作業途中の履歴が、main 上の単一のクリーンなエントリになります。main branch の履歴を、merge された変更ごとに 1 commit で読みやすく保つための人気の merge 戦略です。
なぜ重要か
feature branch はしばしば「typo 修正」や「レビュー対応」といったノイズの多い commit を蓄積します。squash merge はその詳細を 1 つの首尾一貫した commit の背後に隠し、main を見渡しやすく revert しやすくします。トレードオフは、変更がどう進化したかの粒度の細かい中間履歴を失うことです。
関連する概念
- ターゲット branch 上で PR ごとに 1 commit
- 変更全体を一度に revert しやすい
- 中間の commit の粒度を失う
関連ガイド
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…