What are squash merge, merge commit and rebase-and-merge on GitHub?
IntermediateConceptMerge, rebase and cherry-pick
Answer
Merge commit keeps every commit plus a merge commit. Squash merge collapses the PR into one commit on the base branch, giving one commit per PR but losing granular history and making the branch look unmerged to Git. Rebase and merge replays each commit onto the base without a merge commit, creating new SHAs. Admins can restrict which methods are allowed per repo.
More on Merge, rebase and cherry-pick
What is the difference between a fast-forward merge and a merge commit?BeginnerHow does a three-way merge work?IntermediateWhat does `git rebase` actually do?IntermediateMerge versus rebase: how do you decide?IntermediateWhy does a squash-merged branch show as unmerged to `git branch --merged`?IntermediateWhat does `git cherry-pick` do?Beginner