Git Branch Naming Rule Builder & Validator
Compose and validate git branch names against team conventions and git-check-ref-format syntax rules — entirely on this device.
Do it offline:$
How to use it
- Choose between the Builder tab (to construct a new branch) or Validator tab (to test an existing branch name).
- Select your team's naming convention preset (Conventional Commits, Issue / Jira Prefix, Type + Ticket, or Classic GitFlow).
- Specify your branch type prefix, optional ticket identifier, and short task description.
- Review live git-check-ref-format validation and convention pattern compliance checks.
- Copy the normalized branch name or the ready-to-run git checkout -b command directly into your terminal.
Construct consistent, kebab-case Git branch names based on team conventions (Conventional Commits, Jira ticket IDs, GitFlow) and validate against official Git reference syntax rules.
How it works
Git reference names (under refs/heads/) must adhere to POSIX-compliant constraints defined in the git-check-ref-format specification.
Prohibited characters include ASCII control characters, spaces, tildes (~), carets (^), colons (:), question marks (?), asterisks (*), and backslashes (\).
Branch names cannot start or end with a forward slash (/), contain consecutive slashes (//), double periods (..), or end with .lock.
Our builder normalizes descriptions into clean lowercase kebab-case and constructs shell-safe checkout commands entirely in your browser.
Examples
Every example on this page is executed against the same engine that powers the tool, on every build.
Gotchas worth knowing
Common errors
FAQ
Why does git reject branch names with spaces or colons?
Git's revision parsing syntax uses special characters for ref navigation: '~' and '^' specify parent commits, ':' separates revisions from tree paths or refspecs, and '..' defines commit ranges. Disallowing these characters in branch names prevents syntax ambiguity.
What is the recommended maximum length for a Git branch name?
While Git itself doesn't impose a strict 50-character limit, keeping branch names under 50 to 60 characters ensures clean terminal display in shell prompts (PS1/starship) and avoids truncating PR titles in GitHub or GitLab dashboards.
Can two branches be named 'feature' and 'feature/login' simultaneously?
No! Git stores loose refs in a directory structure mirroring the branch path (.git/refs/heads/feature). A filesystem path cannot be both a file and a directory simultaneously, so Git will fail with a ref conflict.