Skip to main content
Skip table of contents

Branch configuration example

Regular Expression Explanation

^(feature|bugfix|hotfix|release|develop)\/[a-z0-9][a-z0-9\-_]*$

→ The branch must follow this pattern to match:

  1. Start with one of the allowed prefixes:

    • feature/, bugfix/, hotfix/, release/, or develop/

  2. Followed by a lowercase alphanumeric name:

    • Can include lowercase letters (a-z), numbers (0-9), hyphens (-), and underscores (_).

    • Must start and end with a letter or number (no trailing - or _).

All of the following error messages are displayed when a pull request is created and can also appear in combination.


Branch configuration in source branch

Configuration

sourceBranch.png

Possible results

Commands

Expected results

BASH
git checkout main
git merge fix-typo

(error) The rule isn’t skipped

→ Missing a required prefix

BASH
git checkout main
git merge feature//double-slash

(error) The rule isn’t skipped

→ Double slashes are not allowed

BASH
git checkout main
git merge feature/new-login

(tick) The rule is skipped

Configuration

excludeSourceBranch.png

Possible results

Commands

Expected results

BASH
git checkout main
git merge fix-typo

(tick) The rule is skipped

BASH
git checkout main
git merge feature//double-slash

(tick) The rule is skipped

BASH
git checkout main
git merge feature/new-login

(error) The rule isn’t skipped

→ The branch matches the naming convention


Branch configuration in destination branch

Configuration

destBranch.png

Possible results

Commands

Expected results

BASH
git checkout main
git merge feature/new-login

(error) The rule isn’t skipped

→ Missing a required prefix

BASH
git checkout release//main
git merge feature/new-login

(error) The rule isn’t skipped

→ Double slashes are not allowed

BASH
git checkout release/main
git merge feature/new-login

(tick) The rule is skipped

Configuration

excludeDestBranch.png

Possible results

Commands

Expected results

BASH
git checkout main
git merge feature/new-login

(tick) The rule is skipped

BASH
git checkout release//main
git merge feature/new-login

(tick) The rule is skipped

BASH
git checkout release/main
git merge feature/new-login

(error) The rule isn’t skipped

→ The branch matches the naming convention

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.