Documentation
Git Workflow
Branch Naming

Branch Naming

Consistent Git branch naming conventions.

Convention

<type>/<description>
<type>/<ticket-id>-<description>

Ticket ID is optional — include it if your team uses an issue tracker.

Branch Types

TypePurposeExample
feature/New featuresfeature/user-authentication
bugfix/Bug fixesbugfix/fix-login-redirect
hotfix/Urgent production fixeshotfix/security-patch
refactor/Code refactoringrefactor/cleanup-api
docs/Documentationdocs/api-docs
test/Test additionstest/add-unit-tests
chore/Maintenance taskschore/update-deps

Examples

# Good - without tickets
feature/user-authentication
bugfix/fix-login-redirect
hotfix/critical-security-fix
refactor/simplify-user-service
chore/upgrade-react-18
 
# Good - with tickets (if using issue tracker)
feature/PROJ-123-user-authentication
bugfix/PROJ-456-fix-login-redirect
hotfix/PROJ-789-critical-security-fix
 
# Bad
feature/new-stuff           # Vague description
john/working               # Personal name
fix                        # Too short, no type
PROJ-123                   # No type or description
feature/implement-the-new-user-authentication-system-with-oauth
  # Too long

Rules

  1. Always lowercase — No capital letters in branch names
  2. Use hyphens — Not underscores or camelCase
  3. Include ticket ID — Optional, but recommended if using issue tracker
  4. Keep it short — Max 50 characters for description
  5. Be descriptive — Clear purpose at a glance

Protected Branches

BranchPurposeProtection
mainProduction codeRequire PR, reviews, CI pass
developIntegration branchRequire PR, CI pass
release/*Release preparationRequire PR

Workflow

# Create feature branch from develop
git checkout develop
git pull origin develop
git checkout -b feature/user-auth
 
# Work on feature...
git add .
git commit -m "feat(auth): add login form"
 
# Push and create PR
git push -u origin feature/user-auth

Branch Cleanup

# Delete local branch after merge
git branch -d feature/user-auth
 
# Delete remote branch
git push origin --delete feature/user-auth
 
# Prune deleted remote branches
git fetch --prune