Skip to content

Enforcing Branch Naming Conventions

Branch name conventions help keep history readable and enable automated workflows. GitHub can enforce naming patterns through branch protection rules.

Common prefixes include:

  • feature/ for new features
  • bugfix/ for fixes
  • hotfix/ for urgent patches
  1. Go to Settings > Branches.
  2. Click Add rule and set the Branch name pattern using glob syntax, e.g. feature/*.
  3. Enable required checks such as status checks or approvals.
  4. Save the rule; pushes to branches matching the pattern must satisfy the protection settings.

To enforce feature branches to match feature/*, create a rule with pattern feature/* and enable Require pull request before merging.