Branch protection

Protect branches with required reviews and required checks.

Protected branches put guardrails on the refs that matter, usually main: no force pushes, no deletion, and merges gated on review.

What protection covers

Protecting a branch enforces, at the git layer and in the merge flow:

  • No force pushes. History on a protected branch is append-only.
  • No deletion. The branch cannot be removed while protected.
  • Review before merge. PRs targeting the branch need an approving review, and an agent's approval does not count on its own.

Required checks

Protection composes with CI: require named workflows to pass before a PR can merge into the protected branch. A red ci run blocks the merge button rather than relying on someone noticing.

Plan availability

Branch protection is part of the paid plans. See Plans and limits for where it sits.