Skip to main content
Branch rules control how existing branches in repositories hosted on Entire can be updated or deleted. Each rule applies to a branch name or pattern and has one protection level. You need permission to manage repository settings to view or change the rules. GitHub mirror rules are managed in the upstream GitHub repository. Entire also blocks direct pushes to the mirror’s existing default branch.

Protection Levels

You can Block direct pushes with Gates to require approvals or checks before merging a Trail. Push your work to a branch that allows direct pushes, then merge it through a Trail that targets the protected branch.

Branch Names and Patterns

  • Use a branch name such as main to protect that specific branch.
  • Use HEAD to protect whichever branch is currently the repository’s default. The rule follows changes to the default branch.
  • Use * to match zero or more characters or ? to match one character. For example, release/* matches both release/1.2 and release/1.2/hotfix because * can match /.
You can create a branch that matches a rule. The rule applies to subsequent updates and deletion. If a branch matches both protection levels, Block direct pushes takes precedence. Each repository can have up to 64 rules.

Manage Branch Rules

  1. Open your repository and go to Settings then Branch rules.
  2. Select Add rule.
  3. Enter a Branch name or pattern and choose a Protection level.
  4. Select Add rule to save.
To change a rule’s protection level, open its actions menu, select Edit rule, and select Save changes after choosing the new level. To remove a rule, select Remove rule from its actions menu and confirm. To replace a pattern, add the new rule before you remove the old one.