Security Architecture

A team wants to stop anyone from rewriting commit history on main with a force push. Which feature does this?

Show the answer

Correct answerB. A branch protection rule on main

AWhy not this: Linters analyze source for rule violations and cannot restrict repository operations like force pushes.

BWhy this is right: Branch protection rules can block force pushes and branch deletion, preserving commit history.

CWhy not this: Canary deployments limit release exposure and do not govern repository history.

DWhy not this: Unit tests verify code behavior and cannot stop history from being rewritten.

Branch protection rules can disallow force pushes and deletion of a branch, preserving history. Linters, canary deployments and unit tests evaluate code or releases and have no control over repository history.