You must stop people from deleting or moving release tags.
IntermediateScenarioProtection, Hooks and Policy
Answer
Situation read → Tags are release identity and must be immutable.
What I'd do →
- Create a ruleset targeting tags with pattern
v*. - Enable "Restrict deletions" and "Restrict updates" ("Block force pushes").
- Allow creation only for release managers or the release bot.
- Verify by trying
git push --delete origin v1.0.0from a test account.
Why → Anyone who can move a tag can change what "v1.0.0" means in production.
Interview tip → Legacy tag protection rules were replaced by rulesets.
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