What are the three ways to merge a pull request on GitHub?
Create a merge commit keeps all commits plus a merge commit. Squash and merge combines them into one commit. Rebase and merge replays the commits onto main without a merge commit, giving linear history.
Explain it simply
Three ways to hand in a project: submit the whole notebook with a cover page (merge commit), submit one clean summary page (squash), or copy every page neatly in order (rebase).
Merge commit preserves exact history but adds merge noise. Squash gives one tidy commit per pull request, popular because messy 'fix typo' commits vanish, though detail is lost. Rebase merge keeps individual commits and linear history, but rewrites their hashes. Repository settings decide which options are enabled for a team.
Example
Create a merge commit -> A-B-C-M (M has two parents)
Squash and merge -> one commit S containing A+B+C
Rebase and merge -> A'-B'-C' (new hashes, no merge commit)What to say in the interview
"Merge commit keeps full history with a merge commit, squash condenses the pull request to one commit, and rebase merge replays the commits linearly. Many teams choose squash for tidy history, and the repository settings control the allowed methods."