Validate branch names against naming conventions and patterns with suggestions. Part of the DevTools Surf developer suite. Browse more tools in the DevOps / CI-CD collection.
Use Cases
Enforce naming conventions in CI pre-push hooks
Validate branch names against Jira ticket format before PR creation
Audit existing branch names for legacy naming inconsistencies
Onboard engineers to the team's branching convention interactively
Tips
Select your team's convention (Conventional Commits, Jira prefix, GitHub Flow) to get context-specific validation rules
The validator flags characters that cause issues on case-insensitive file systems (macOS HFS+) — useful for cross-platform teams
Use the bulk input mode to validate a list of branch names from a CI script or pre-commit hook
Fun Facts
Git branch names are stored as file paths in .git/refs/heads/. Characters invalid in file names on any major OS — including colons, asterisks, and backslashes — are also invalid in branch names for this reason.
The 'feature/', 'bugfix/', 'hotfix/', 'release/' prefix convention was popularized by Vincent Driessen's 'A Successful Git Branching Model' (git-flow) published in 2010. It became one of the most-starred Git articles ever written.
Git enforces 41 distinct naming rules for references, including restrictions on double dots, question marks, control characters, and names ending in .lock. Many of these rules exist to avoid confusion with Git's own internal reference naming.
FAQ
Why can't branch names contain certain characters?
Git stores branches as file paths in .git/refs/. Characters disallowed in the OS file system (colons, asterisks, spaces, backslashes) are invalid. Additionally, Git reserves some patterns (like '..') for its own ref notation.
What is the Conventional Commits standard for branches?
There is no official Conventional Commits standard for branch names — only for commit messages. Common conventions include type/description (feat/user-auth) or type/ticket-desc (feat/PROJ-123-user-auth).
Does branch name length matter?
Git has no enforced limit, but very long names (~200+ chars) can cause issues on Windows due to MAX_PATH limitations. GitHub and GitLab display truncated names in the UI beyond ~50 characters, so keep branch names concise and descriptive.