Protect main with required reviews, status checks, no force-push, and CODEOWNERS file.
Branch Protection Rules
Protect important branches (main, develop) from accidental force pushes and require code review.
- Require PR reviews — N approvals before merge
- Require status checks — CI must pass (tests, lint)
- Require up-to-date branch — must be current with base
- No force pushes — protect history
- No deletion — prevent accidental branch delete
- Required reviewers — specific teams must approve
- CODEOWNERS — auto-request review from owners
# .github/CODEOWNERS
# Global owners
* @alice @bob
# Backend
/api/ @backend-team
# Docs
/docs/ @docs-team