Merge Types — Rebase vs Squash vs Merge Commit
Understanding the three merge strategies, how they affect history, and when to use each one
You've got a feature branch with five commits. The PR is approved. You click "Merge" on GitHub and... wait. There are three options. Merge commit. Squash and merge. Rebase and merge.
They all get your code into main. But they do it in fundamentally different ways, and the choice shapes what your project history looks like. Pick the wrong one consistently and your git log becomes either an unreadable mess or a suspiciously clean lie.
Let's break down each one so you know exactly what you're choosing — and can tell your AI agent which approach to use.
The Setup
Imagine this scenario. Your main branch has commits A, B, C. You created a feature branch and made commits X, Y, Z. Meanwhile, someone pushed commit D to main.
main: A---B---C---D
\
feature:This lesson is part of the Guild Member curriculum. Plans start at $29/mo.
