Rules on a branch such as main (branch protection in GitHub, branch policies in Azure Repos) that stop people pushing to it directly and require reviewed pull requests for merges.
Read more: Microsoft Learn
In the Ultra Transcenders books
Each book explains Branch protection in context, with comparison tables and the common traps.
Terms in this definition
- Branch policies
Requirements a pull request must meet on an Azure Repos branch, such as minimum reviewers, resolved comments, linked work items, status checks and build validation. GitHub offers rulesets and branch protection rules for this.
- Azure Repos
Azure DevOps' version control: Git (and legacy centralised TFVC), guarded by branch permissions and policies. GitHub's counterpart is its repositories.
- Stop sequence
One of up to four strings that make the model halt generation; the sequence itself is not included in the output.
Related terms
- Require linear history
Stops merge commits landing on chosen branches, through branch protection or a ruleset, so pull requests have to be squashed or rebased. At least one of those methods has to be enabled for the repository beforehand.
- Require review from Code Owners
A ruleset or branch protection option meaning changes need sign-off from someone who owns the affected files according to CODEOWNERS. One approval from any listed owner is sufficient.
- Ruleset
A named set of GitHub rules for branches, tags or pushes, applied at repository or organisation level. Several can stack and each can be turned on or off, making them the modern replacement for branch protection rules.