When naming git branches, following a professional naming convention is a good practice. When creating a git branch, we can follow these guidelines:
Use a consistent prefix:
- feature/ for new features
- bugfix/ or fix/ for bug fixes
- hotfix/ for critical fixes to production
- improvement/ to enhance existing features
- release/ for release branches
- docs/ for documentation changes
- test/ for testing or experimenting
Prefix examples:
- feature/add-user-authentication
- bugfix/fix-checkout-calculation
- hotfix/security-patch-login
- improvement/optimize-database-queries
- release/v1.2.3
- docs/update-api-documentation
- test/experiment-new-algorithm
Sometimes, we may need to work with specific team member branches. In these cases, we can follow this format:
Team member Prefix examples:
- feature/therakib7/add-user-authentication
- bugfix/rakib/fix-checkout-calculation
- hotfix/hasan/security-patch-login
- improvement/rakib-hasan/optimize-database-queries
Note: After a release to production, don’t forget to delete any unnecessary branches.
Leave a Reply