Branch Protection
ELI5 — The Vibe Check
Branch Protection puts a velvet rope around your main branch. No force pushes, no direct commits, mandatory reviews, required CI checks. It's the adult supervision your codebase needs. Without it, anyone could push broken code to production at 3 AM.
Real Talk
Branch protection rules in GitHub restrict how code reaches protected branches. Rules include required pull request reviews, required status checks, linear history enforcement, signed commits, and restrictions on who can push. Rulesets provide more granular organization-wide control.
When You'll Hear This
"Branch protection requires 2 approvals and passing CI before merge." / "Nobody can push directly to main — branch protection enforces PRs."
Related Terms
Auto-Merge
Auto-Merge is the 'merge it when it's ready' button. Enable it on a PR, and once all checks pass and approvals are in, it merges automatically.
Git Flow
Git Flow is a branching model with specific branches for features, releases, hotfixes, and development. It's like a highway system with designated lanes.
Merge Queue
Two PRs both pass CI separately. Both merge. Main is now broken.
Status Checks
Status Checks are the green checkmarks (or red X marks) on your PR. They tell you if CI passed, if the code is safe, if the build works.