Skill 2.1.3

Implement branch merging restrictions by using branch policies and branch protection rules

Key Concepts

Azure Repos can limit merge types, allowing any of basic merge, squash, rebase with fast-forward, or rebase with merge commit. Enabling a branch policy prevents direct pushes to that branch, and only users with the bypass permissions can override it.

GitHub can restrict who may push, require linear history, block force pushes and deletions, and require a merge queue. Rulesets add bypass lists for roles, teams or apps, and several rulesets can apply at once, in which case the most restrictive rule wins.