Git Branch Naming Conventions: Best Practices Every Team Should Follow
The definitive guide to git branch naming. Learn feature/bugfix/hotfix prefixes, ticket ID integration, naming formats, and team conventions that scale. With a free branch name generator.
In This Article
Why Branch Naming Matters More Than You Think
Branch names are not just labels — they are communication. A well-named branch tells the entire team what work is happening, why, and by whom, without opening a single file.
Good branch names enable: automated CI/CD pipelines that deploy feature branches to preview environments, sprint boards that auto-link branches to tickets, code review workflows where reviewers understand context at a glance, release management that filters branches by type, and debugging sessions where git log makes sense months later.
Bad branch names create: confusion about what a branch contains ("fix-stuff", "update-3", "johns-branch"), CI/CD failures when pipelines cannot parse branch patterns, merge conflicts from parallel work on unclear scopes, and archaeological expeditions through git history to understand what happened.
The difference between a team that moves fast and one that drowns in confusion often comes down to conventions this simple.
We built the Branch Name Generator after a sprint where three developers on our team created branches named "fix-stuff", "johns-updates", and "new-feature-2" for the same project. The code review was chaos — nobody could tell which branch addressed which ticket. After adopting a strict prefix + ticket-ID convention and building a tool to enforce it, our PR review time dropped noticeably because reviewers could understand the scope of changes before opening a single file.
The Standard Prefix System
Most successful teams use a prefix system based on the type of work. Here are the standard prefixes and when to use each:
feature/ — New functionality being added. Examples: feature/add-dark-mode, feature/JIRA-456-user-authentication.
bugfix/ — Fixing a known bug. Examples: bugfix/login-redirect-loop, bugfix/PROJ-789-null-pointer-on-checkout.
hotfix/ — Urgent fix for production. Examples: hotfix/payment-gateway-timeout, hotfix/security-patch-xss. Hotfixes bypass normal review cycles and deploy directly.
release/ — Preparing a release. Examples: release/v2.4.0, release/2026-q1-launch. These branches stabilize code before deployment.
chore/ — Maintenance tasks that are not features or fixes. Examples: chore/update-dependencies, chore/migrate-to-node-20.
refactor/ — Code restructuring without behavior changes. Examples: refactor/extract-auth-service, refactor/replace-redux-with-zustand.
docs/ — Documentation updates only. Examples: docs/update-api-reference, docs/add-contributing-guide.
test/ — Adding or updating tests. Examples: test/add-payment-integration-tests, test/increase-coverage-auth-module.
ci/ — CI/CD pipeline changes. Examples: ci/add-staging-deploy, ci/fix-docker-build.
Our Branch Name Generator supports all of these prefixes and auto-detects the right one based on your task description.
Naming Formats: kebab-case vs snake_case vs camelCase
The three most common formats for the descriptive part of a branch name:
kebab-case (most popular): feature/add-dark-mode-toggle. Words separated by hyphens. Readable, URL-safe, and the de facto standard in most open-source projects. Git itself uses hyphens in its own branch naming (e.g., maint-2.38).
snake_case: feature/add_dark_mode_toggle. Words separated by underscores. Common in Python ecosystems and some enterprise teams. Slightly harder to type but equally readable.
camelCase: feature/addDarkModeToggle. No separator — capitalization indicates word boundaries. Compact but harder to scan visually. More common in Java and .NET ecosystems.
Our recommendation: use kebab-case unless your team has an established convention. It is the most widely understood, most readable at a glance, and works in every context (URLs, CLI, CI/CD pipelines, chat messages).
Whatever format you choose, be consistent. A repository mixing add-dark-mode, add_user_auth, and addPaymentFlow is worse than consistently using any single format.
Integrating Ticket IDs
If your team uses JIRA, Linear, GitHub Issues, or any project management tool, embedding the ticket ID in the branch name creates automatic traceability:
Pattern: prefix/TICKET-ID-short-description
Examples: feature/JIRA-456-add-dark-mode, bugfix/GH-123-fix-login-redirect, chore/LIN-789-update-deps.
This enables: JIRA, Linear, and GitHub automatically linking branches to tickets. PR descriptions auto-populated from ticket titles. Sprint boards showing which tickets have active branches. Release notes generated from merged branch names.
Most CI/CD systems can extract the ticket ID from the branch name using a simple regex like ([A-Z]+-\d+) and inject it into deployment notifications, Slack messages, and changelog generators.
Our Branch Name Generator automatically detects ticket IDs in your input — paste "JIRA-456 Add dark mode toggle to settings page" and it extracts JIRA-456 and formats the rest as the branch description.
Rules That Prevent Problems
Beyond conventions, some rules prevent real technical issues:
Keep branch names under 60-80 characters. Some CI systems, Windows file paths, and older git versions have issues with very long branch names. Our generator has a configurable max length slider for this reason.
Use only lowercase letters, numbers, hyphens, and forward slashes. Avoid spaces (use hyphens), special characters, unicode, and uppercase (some systems are case-insensitive, leading to duplicate branch conflicts).
Never use consecutive dots (..) or end with .lock — these are reserved by git and will cause errors.
Do not include the developer name in the branch — use the git author metadata for that. Exception: if your team explicitly uses username prefixes (john/feature/add-dark-mode) for CI/CD namespace isolation.
Delete branches after merging. Stale branches clutter the repository and confuse the team. Set up auto-delete on merge in GitHub/GitLab settings.
Team Conventions That Scale
For teams larger than 3-4 people, document your branching convention and enforce it:
Create a CONTRIBUTING.md in your repository root that includes: the prefix list your team uses, the naming format (kebab-case recommended), whether ticket IDs are required, the max branch name length, and examples of good and bad branch names.
Set up a CI check that validates branch names against your convention. A simple regex in your CI pipeline can reject branches that do not match the pattern: ^(feature|bugfix|hotfix|release|chore|refactor|docs|test|ci)\/[a-z0-9][a-z0-9-\/]*$.
Consider using git hooks (pre-push) to validate branch names locally before pushing. This catches issues before they reach the remote.
For onboarding: share our Branch Name Generator with new team members. They paste their task description, select the right prefix, and get a perfectly formatted branch name that matches your team convention — no need to memorize the rules.
