Interview Prep/Git & GitHub/Protection, Hooks and Policy

Release branches (`release/*`) need stricter rules than feature branches.

IntermediateScenarioProtection, Hooks and Policy
Answer

Situation read → One ruleset per branch is tedious; patterns solve it.

What I'd do →

  1. Ruleset targeting refs/heads/release/*.
  2. Require 2 approvals, code owner review, and the full test workflow.
  3. Restrict who can push or merge to the release managers team.
  4. Block deletion and force pushes.

Why → Patterns apply automatically to every new release branch, so nobody forgets to protect it.

Interview tip → Test with "evaluate" mode before enforcing.

All Git & GitHub questions Roadmap: Git & GitHub

More on Protection, Hooks and Policy