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

A security incident requires you to temporarily stop all merges to `main`.

IntermediateScenarioProtection, Hooks and Policy
Answer

Situation read → You need a fast, reversible freeze.

What I'd do →

  1. Prepare a "freeze" ruleset in advance with an empty bypass list, set to Disabled.
  2. During the incident, switch it to Active; it blocks all merges and pushes.
  3. Alternatively, restrict the merge queue or temporarily mark a required check as failing via a variable.
  4. Reverse it afterward and note it in the incident timeline.

Why → A rehearsed switch beats improvising under pressure.

Interview tip → Archiving the repo is too blunt and also blocks issues.

All Git & GitHub questions Roadmap: Git & GitHub

More on Protection, Hooks and Policy