Git Branch Name Generator

Turn a branch type, ticket number, and free-text description into a clean, convention-compliant Git branch name — kebab-cased, punctuation-stripped, collapsed, and truncated to a configurable max length. Supports feature/, fix/, hotfix/, release/, and more. Shows the primary name plus two alternative formats so you can pick the one that matches your team's convention.

How to use the Git Branch Name Generator

Select a Type that matches your change category — feature for new functionality, fix for bug fixes, hotfix for urgent production patches, chore for maintenance tasks, release for release commits, docs for documentation, and refactor for code restructuring without behavior change.

Enter your Ticket / issue number (e.g. JIRA-123, GH-456, or leave blank). In the Description field write the branch intent in plain English — the tool converts it to kebab-case by lowercasing all text, stripping punctuation (keeping letters, digits, and hyphens), and collapsing consecutive hyphens. The result is truncated at the nearest word boundary within Max length.

Choose Separator between the type prefix and the slug: / creates a hierarchical namespace in most Git GUIs (e.g. Sourcetree, GitKraken show these as folders), while - keeps everything flat. The output shows three format variants: with type+ticket, with type only, and ticket-first. Click Copy to copy the primary branch name.

Why Branch Naming Conventions Matter

A consistent Git branch naming strategy is more than housekeeping — it enables automation, improves traceability, and keeps large repositories navigable. The type/ticket-description pattern is the most widely adopted convention because it packs the intent (what kind of change?), traceability (which ticket?), and context (what does it do?) into a single identifier that most CI/CD tools, code-review platforms, and project management integrations can parse automatically.

The kebab-case requirement exists because branch names are used in URLs (pull request links, deployment previews, pipeline jobs) and as environment variable fragments in many CI systems. Spaces are forbidden, and characters like ~, ^, :, ?, *, [, and \ are reserved by Git's refname rules. Uppercase letters are allowed but cause problems on case-insensitive filesystems (macOS, Windows) where Feature/Login and feature/login resolve to the same branch.

The max length matters because some deployment tools embed the branch name in hostnames or file paths that have system-imposed limits. A 50-character limit is a safe default; GitHub has a 255-byte limit per refname component, but many CD platforms impose tighter constraints. Truncating at a word boundary rather than mid-word keeps the name readable even when it is shortened.

Common use cases

  • JIRA-integrated workflows — include the ticket key so tools like Jira Smart Commits and GitHub/Jira integration automatically link branches to issues.
  • CI/CD environment names — pipelines that create per-branch preview environments need short, URL-safe branch names to avoid hostname length errors.
  • Monorepo management — type-prefixed branches let tooling selectively trigger pipelines; a docs/ branch may skip the full test suite.
  • Release trackingrelease/v2.4.0 branch names integrate with changelog generators like semantic-release and conventional-commits tooling.
  • Code review clarity — reviewers immediately understand scope from the branch name without reading the PR description.

Frequently asked questions

Should I use / or - as the separator?

Use / if your team uses Git GUIs like Sourcetree or GitKraken — they render slash-separated names as nested folder trees, making branch lists easier to browse. Use - for flat workflows or when your tooling treats / as a path separator in ways that cause issues.

What characters are illegal in Git branch names?

Git forbids: spaces, ~, ^, :, ?, *, [, \, consecutive dots (..), a leading dot, a trailing dot or .lock, and the sequence @{. This tool strips all unsafe characters automatically.

What if I don't use JIRA or have no ticket?

Leave the Ticket field blank. The generated name will be type/short-description without a ticket prefix. This is common for open-source projects, personal repos, and chore/docs changes that do not warrant a tracked issue.

Why truncate at a word boundary instead of a character limit?

Mid-word truncation makes branch names harder to read — feature/add-user-auth is clearer than feature/add-user-au. The tool walks back from the max-length position to the last hyphen so the truncated name remains a recognizable fragment.

How does the tool handle non-ASCII characters in the description?

Non-ASCII letters are stripped along with other non-alphanumeric characters. If you work with non-Latin scripts, transliterate the description into ASCII first before generating the branch name.