Naming Branches
When contributing to existing projects, look for and stick with the agreed branch naming convention. In open source projects this information is typically found in the contributing instructions, often in a file named CONTRIBUTING.md
.
In the beginning of a new project the team agrees on the project conventions including the branch naming strategy.
Common Branch Naming Patterns
1. Feature-based Convention
Examples:
2. Owner-based Convention
Examples:
3. Release-based Convention
For teams working with release branches:
4. Environment-based Convention
For GitOps workflows:
Multi-Cloud Development Considerations
When working across multiple cloud providers, you might want to include cloud provider information in branch names:
Examples:
Automation and Integration
CI/CD Pipeline Integration
Well-structured branch names can trigger specific CI/CD workflows:
Automatic Work Item Linking
Branch names with issue numbers enable automatic linking in tools like Azure DevOps:
Branch Naming Best Practices
Keep it simple - Names should be intuitive and easy to remember
Be consistent - Once a convention is chosen, stick to it
Use lowercase - Avoid case sensitivity issues across systems
Use hyphens for word separation (not underscores or spaces)
Keep it short - Long branch names become unwieldy
Include relevant information only - Exclude redundant details
Different Conventions for Different Development Models
Trunk-Based Development
In trunk-based development, branches are short-lived and merged frequently:
or for one-day branches:
GitFlow
For GitFlow, branches follow a more structured naming convention:
GitHub Flow
With GitHub Flow's simplified approach:
Real-World Examples
Enterprise SaaS Project
Infrastructure as Code Project
Microservices Project
Automated Branch Name Enforcement
Consider enforcing branch naming conventions through hooks or CI checks:
Last updated