GitHub Merge Methods, Required Reviews and Checks
Three history shapes
Merge commit integration retains original feature commits and adds a commit with two parents. Squash integration combines the feature changes into one new commit on the destination; original feature commits are not ancestors through that integration. Rebase and merge replays commits onto the base, producing a linear history with new commit IDs on GitHub. In the disposable lab the base diverges and the two feature commits are replayed locally, which demonstrates similar graph shape, not the GitHub implementation. The local feature branch itself is kept unchanged using a scratch replay branch.
Choose under policy
A team may value original ancestry, one coherent commit per feature, or a linear sequence of individual commits. Select among methods enabled by the repository and allowed by branch rules. Required reviews, code-owner reviews and status checks may block merging. A merge queue can test proposed changes against the latest target and queued changes before integration. It is a hosted policy mechanism, not a Git command; availability and settings vary. Never bypass requirements to make a demo succeed.
Verify before cleanup
After an authorized merge, fetch the destination, check its history and expected files, and verify the hosted PR state separately. Closing a PR without merging does not integrate it. Only delete branches when the team no longer needs them and the relevant work is preserved. After squash or rebase, ancestry-based deletion may refuse even though the content is integrated; inspect history and content rather than blindly forcing deletion. In the lab, all three methods yield the same final file tree for this conflict-free scenario.
Practice example
git log --oneline --graph --allgit diff --exit-code merge-result squash-resultgit diff --exit-code squash-result replay-resultIn the prepared fixture both comparisons exit 0 with no output: identical final tracked trees. The merge-result, squash-result and replay-result branches have different histories.
Check your understanding
Predict parent count and original-feature ancestry for all three methods, and decide whether a pending required check allows merge.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
GitHub Merge Methods, Required Reviews and Checks — knowledge check
Reason about pull request workflows and integration history.
Which method adds a two-parent integration commit?
What does squash integration produce in this fixture?
What happens to original feature commit IDs under GitHub rebase and merge?
A required check is still pending. What is appropriate?
Why may branch -d refuse after squash?