DevOps / Github Interview questions
What are branch protection rules in GitHub?
Branch protection rules restrict what can happen to a specific branch (commonly main), such as requiring pull requests before merging, requiring passing status checks, requiring a minimum number of approving reviews, and blocking force pushes or deletions.
These rules apply regardless of a user's general write access to the repository; even someone with admin permissions can be blocked from pushing directly unless the rule explicitly allows it. Combined with required status checks tied to a GitHub Actions workflow, protection rules make sure code can't reach a protected branch without passing both automated tests and human review.
More Related questions...