Git | Branch naming and commit message conventions

More often than not, a novice developer can create branch names and commit messages which is difficult to understand, making things harder to track for which story or defect a particular change or commit is done. Thus creating a bottleneck to understand and debug the issues in future iterations.

In my projects, I follow the below rules while creating branches and in commit message formats.

Branch Naming Conventions :

If it is a new feature branch, create a branch with :
feature/<story-number>-<one-line-summary-of-feature>

If it is a bugfix branch, create a branch with :
bugfix/<defect-number>-<one-line-summary-of-feature>

All branch names in small-cases

Commit Message Conventions :

<Story Number> | One line summary of story

<Defect Number> | One line summary of defect

This maintains consistency across the git repositoryand it becomes easier to understand which commit is for which story/defect, making merge conflicts resolution easier.






Leave a Reply