| name | branch-protection-rules |
| description | Guidance and best practices for branch protection rules. |
Branch Protection Rules
Overview
Protect critical branches (main, develop) from accidental deletion or bad code.
Key Settings (GitHub/GitLab)
- Require Pull Request Reviews: Require at least 1 or 2 approvals before merging.
- Require Status Checks: Ensure CI pipelines (tests, lint) pass before merging.
- Require Signed Commits: Verify commit signatures.
- Prevent Force Pushes: Disable force pushing to protected branches.
- Include Administrators: Apply rules to admins as well.