Git Branch Name Generator
Turn a ticket number and a description into a clean, valid branch name.
What is Branch Names?
A branch name generator and validator. It builds `type/ticket-description` from your input and then verifies the result the way git does, so a name that passes here will not be rejected by git switch -c or a remote.
How it works
The description is normalised to ASCII, split into words and joined with the separator you choose. The ticket number goes in front unless it is already part of the description. Truncation shortens the slug only, never the prefix, because CI and tooling key off the prefix. Finally the name is checked for the characters git refuses, plus `..`, `@{`, a leading dash, `.lock` and empty path segments.
- Paste or fill in the input. Drop in a commit message, a diff, a package.json, a path list or a set of options. The tool reads it locally — nothing is uploaded and no repository is contacted.
- Adjust the rules to match your project. Every linter here takes its convention from a setting you can change: allowed commit types, header length, target branch length, known branch names. Set them once to what your team actually uses.
- Copy the result. Generated files copy straight to the clipboard or download as a real file with the right name (.gitignore, CODEOWNERS, LICENSE, COMMIT_EDITMSG), and Reset returns every field to its default.
Examples
A commit message that fails CI
"Updated(auth): Fixed the expired-token redirect." is rejected by release automation and reported here with the exact reasons: unknown type, capitalised description, past tense and a trailing period.
A .gitignore that only half works
The Checker shows which rule decides a path — and why `!keep.txt` inside an ignored directory never fires, the mistake that sends people to Stack Overflow.
A dependency bump nobody reviewed
The package.json Diff separates added, removed and changed entries per section, so a caret bump of a runtime dependency does not hide inside a lockfile-sized pull request.
A diff pasted from a code review comment
The Diff Viewer understands several `diff --git` blocks, mode-only changes, renames and binary stubs, and calls out a pasted `--stat` summary instead of rendering an empty box.
Common mistakes
Committing a .gitignore without checking it
Rules look right and behave differently: a pattern containing a slash is anchored to the root, a trailing slash means directories only, and a file inside an ignored directory cannot be re-included. Check the paths that matter before you commit the file.
Rewriting published history
A clean commit history is worth having, but amend, rebase and filter-repo change commit hashes. Only rewrite commits that nobody has pulled; after a rewrite, push with --force-with-lease rather than --force.
Treating a generated file as if it were reviewed
These tools produce a starting point, not a decision. Check the licence text against the canonical source, read the security policy before publishing it, and make sure a CODEOWNERS team actually exists — GitHub silently ignores rules whose owner has no write access.
Putting slow checks in a pre-commit hook
A hook that takes 30 seconds gets bypassed with --no-verify within a week, and then it protects nothing. Keep pre-commit to formatting and linting, move type checks and tests to pre-push or CI.
Frequently asked questions
Which characters are actually forbidden in a branch name?
Space, tilde, caret, colon, question mark, asterisk, open bracket, backslash, control characters, the sequences `..` and `@{`, and a leading dash or trailing slash or `.lock`. Git also refuses a double slash because it creates an empty path segment.
Should the ticket number come before or after the description?
Before. `feature/proj-482-handle-expired-tokens` sorts next to its siblings, remains greppable by ticket ID, and matches the ticket-prefix commit-message rule you can run in a commit-msg hook.
Why avoid uppercase branch names?
macOS and Windows filesystems are case-insensitive while Linux is not, so `Feature/X` and `feature/x` can be the same branch locally and two different branches on the remote — a genuinely confusing failure mode.