Branch Naming Conventions

16.1 Why Branch Naming Matters

Clear branch names help teams:
Instantly understand the purpose of a branch
Reduce confusion during code reviews
Avoid accidental merges into wrong branches
Integrate smoothly with CI/CD and issue trackers
Poor naming like test123 or new-branch creates long-term maintenance issues.

16.2 Common Branch Categories

Most teams organize branches by purpose.

Main Branches

These represent stable or long-lived code:
main / master → production-ready code
develop → integration branch for upcoming releases
These branches should remain clean and protected.

16.3 Feature Branches

Used for new features or enhancements.

Format:
1feature/<short-description>

Examples:
1feature/user-auth 2feature/cart-discount 3feature/profile-settings

Best practices:
Use lowercase
Use hyphens instead of spaces
Keep names short but meaningful

16.4 Bugfix Branches

Used to fix bugs in existing functionality.

Format:
1bugfix/<short-description>

Examples:
1bugfix/login-crash 2bugfix/navbar-alignment

For urgent production issues, some teams prefer:
1hotfix/<issue>

16.5 Release Branches

Used when preparing a versioned release.

Format:
1release/<version>

Examples:
1release/1.0.0 2release/2.3.1

Release branches allow:
Final bug fixes
Version bumps
Release-specific testing

16.6 Chore / Maintenance Branches

Used for non-feature tasks.

Format:
1chore/<task>

Examples:
1chore/update-dependencies 2chore/refactor-auth-service

Useful for:
Dependency upgrades
Code refactoring
Build system changes

16.7 Including Issue or Ticket IDs

When using tools like Jira, GitHub Issues, or Linear:

Format:
1feature/JIRA-123-user-auth 2bugfix/ISSUE-45-fix-crash

Benefits:
Direct traceability
Automated linking in PRs
Easier auditing

16.8 Naming Rules to Follow

General rules that scale well:
Use lowercase
Use hyphens (-) instead of underscores
Avoid vague names (test, temo, new)
Keep it readable and searchable
Be consistent across the team

16.9 Example Team Convention

A simple and effective standard:
1<type>/<ticket-id>-<short-description>

Example:
1feature/JIRA-210-add-payment-gateway 2bugfix/JIRA-222-fix-checkout-error

16.10 Key Takeaways

Branch naming improves clarity, collaboration, and automation.
Use prefixes like feature/, bugfix/, hotfix/, release/, and chore/.
Keep names lowercase, short, and descriptive.
Include issue IDs for traceability when possible.
Consistency matters more than perfection—agree on a team standard.