Custom Branch Name Templates and Patterns
Create custom branch name templates using {type}, {ticket}, and {title} variables to match your team's specific naming conventions and CI/CD requirements.
Detailed Explanation
Custom Branch Name Templates
The Git Branch Name Generator uses a template system with three variables — {type}, {ticket}, and {title} — that can be arranged in any order with any separator to match your team's specific conventions.
Built-in Templates
| Template | Example Output |
|---|---|
{type}/{ticket}-{title} |
feature/proj-123-add-auth |
{type}/{title} |
feature/add-auth |
{ticket}-{title} |
proj-123-add-auth |
{type}/{ticket}/{title} |
feature/proj-123/add-auth |
Advanced Template Patterns
Teams can create more complex patterns by adding literal text to the template:
| Template | Example Output | Use Case |
|---|---|---|
{type}/user/{ticket}-{title} |
feature/user/proj-123-add-auth |
User-namespaced |
{type}/{ticket}-wip-{title} |
feature/proj-123-wip-add-auth |
Work-in-progress marker |
{type}/v2/{ticket}-{title} |
feature/v2/proj-123-add-auth |
Version-scoped |
How Template Variables Work
Each variable is replaced and sanitized independently:
{type}— Replaced with the selected branch type (feature, bugfix, etc.). Always lowercase, never modified.{ticket}— Replaced with the ticket/issue input. Sanitized according to options (lowercase, strip special chars). The#prefix from GitHub issues is removed.{title}— Replaced with the title/description. Spaces are converted to the convention's separator, special characters are stripped, and the result is lowercased if the option is enabled.
Team Convention Examples
Startup with GitHub Issues:
Template: {type}/{ticket}-{title}
Result: feature/123-add-user-auth
Enterprise with JIRA and team namespaces:
Template: {type}/backend/{ticket}-{title}
Result: feature/backend/plat-1234-api-redesign
Solo developer, date-based:
Template: {type}/{title}
Result: feature/add-dark-mode
Tips for Choosing a Template
- Include
{ticket}if your team uses any issue tracker — traceability is invaluable - Keep the template simple enough that developers can type branch names manually when needed
- Test your template with long titles to ensure the truncation produces sensible results
- Document your chosen template in the repository's CONTRIBUTING.md file
Use Case
A team lead wants to establish a custom branch naming template that includes the team name as a namespace, integrates with their JIRA-based workflow, and is short enough for CI/CD artifact naming.