Git Branching Naming Convention: Best Practices

Regular Git Branches

  • Development (dev) is the main development branch. The dev branch’s idea is to make changes in it and restrict the developers from making any changes in the master branch directly. Changes in the dev branch undergo reviews and, after testing, get merged with the master branch.
  • Master (master) is the default branch available in the Git repository. It should be stable all the time and won’t allow any direct check-in. You can only merge it after code review. All team members are responsible for keeping the master stable and up-to-date.
  • QA (QA), or test branch, contains all the code for QA testing and automation testing of all changes implemented. Before any change goes to the production environment, it must undergo QA testing to get a stable codebase.

Temporary Git Branches

  • Bug Fix
  • Hot Fix
  • Feature Branches
  • Experimental Branches
  • WIP branches

Git Branching Naming Convention

1. Start branch name with a Group word

  • bug-logo-alignment-issue — the developer is trying to fix the logo alignment issue;
  • wip-ioc-container-added — the branch relates to the task to add an IoC container in progress.

2. Use Unique ID in branch names

3. Use Hyphen or Slash as Separators

  1. It increases the readability and helps to avoid confusion;
  2. It makes it easier to manage, especially if you are dealing with many branches.

4. Git Branch with Author Name

<author>_<branch-type>_<branch-name>

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store