Interview Prep/Git & GitHub/Branch protection, rulesets, CODEOWNERS and review at scale

What do "dismiss stale approvals" and "require approval of the most recent push" prevent?

IntermediateProductionBranch protection, rulesets, CODEOWNERS and review at scale
Answer

Without them an author can get approval and then push different code. Dismissal removes approvals when new commits arrive, and the most-recent-push rule requires someone other than the pusher to approve the final state. This closes the last-minute-change hole that audit teams ask about.

All Git & GitHub questions Roadmap: Git & GitHub

More on Branch protection, rulesets, CODEOWNERS and review at scale