Glossary · Term

branch protection

← all terms

Definition

Plain language

Rules on a code repository that block changes from being merged without review.

As stated in the literature

Repository configuration on Git platforms that requires pull requests, reviews, or status checks before changes can be merged to protected branches.

Why it matters: It's the simplest line of defense against accidental or malicious changes — including ones made by an over-eager AI coding agent — being merged into production.

For example, with branch protection on, a developer can't push directly to main — they have to open a PR and get a review approved first.

Related terms

Git