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 →
- Prepare a "freeze" ruleset in advance with an empty bypass list, set to Disabled.
- During the incident, switch it to Active; it blocks all merges and pushes.
- Alternatively, restrict the merge queue or temporarily mark a required check as failing via a variable.
- 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.
More on Protection, Hooks and Policy
You are asked to protect `main`. Which rules do you turn on?BeginnerClassic branch protection or repository rulesets: which do you use?IntermediateA required status check never reports and the PR is stuck as "Expected — Waiting for status".IntermediateProduction is down and the fix needs to merge now, but approvals are required.IntermediateYou want to stop developers from committing obvious mistakes like debug prints, trailing whitespace or secrets.BeginnerHooks in `.git/hooks` are not shared with the team. How do you distribute them?Intermediate