DEV Community

Cover image for summary for git branch naming :
Munezerojosue
Munezerojosue

Posted on

summary for git branch naming :

what is git branch naming : its process of naming different branches by different developers doing on the same project and after merge them to finalize their project

        in different companies which have so many project to work on where they supposed to have different
        workers they most use various number of workers on the same project where use one repository on 
       different branches in order manager every single progress of work there are doing together:
Enter fullscreen mode Exit fullscreen mode

so there are two categories:

*code flow: its a branch which last longer from the beginning of the project and every changes made till the end

here different types of them:

*development: every single errors and new features should be brought here to be resolved .

*QA/TEST: contain all code done and ready for QA testing.

*staging: this where every features before its brought to the production code must pass through in order to be checked.

*master: its its a branch where repository being published or represented.

TEMPORARY BRANCHES:

these are branches which is should created or deleted by developer anytime they want.

*feature: its a branches where any change for a new module should be done on this branches and contain other type of branch in it where all merge request and pull request needed to pull out by using these branches:-feature/integrate-swagger
-feature/jira-1234
-feature/jira-1234-support-dark-theme

*bug fix :if there is any changes in code where this a mistake and code being rejected you can use these two branches:

              -bugfix/more-grey-shades
              -bugfix-jira-1444_gray-on-blur-fix
Enter fullscreen mode Exit fullscreen mode

*hot fix :if you need to fix any blocker u can use temporary path by using critical framework or configuration changes.
and those changes could merged on this branches directly:
- hotfix/disable-endpoint-zero-day-exploit
-hotfix/increase-scaling-threshold.

*experimental: its a branches which contain different sub-branches
for playing around:

          -build: help to build a specific artifacts and coverage runs  eg: build/jacoco-metric
          -release: its help for releasing specific version
          eg: release/myapp-1.01.123
Enter fullscreen mode Exit fullscreen mode

*merge: its a temporary for resolving merge conflict and if two developer are using two branches they use to merge and finalize their project eg:-merge/dev_lombok-refactoring
-merge/combined-device-support

BEST PACTICES FOR NAMING BRANCH :

1 use separators: when you are writing a branch name use hyphen(-) or slash(/) to increase readability eg: optimize-data-analysis

2 START A NAME WITH CATEGORY WORDS :hot fix: for quickly fixing any issues

  • bugfix: for fixing bugs *feature: its adding or changing features *wipe: its for work in progress

3 USETHE ID OF THESE ISSUE: make it easy to identify the task
eg: wipe-451-optimize-data-analysis

4 INCLUDE AUTONAME: when an author name include help to keep tracking a developers work eg: jane.doe-bugfix-broken-link.

5 AVOID USING NUMBERS ONLY: its not good to use numbers only can create confusion instead include ID and keywords.

6 AVOID LONG BRANCH NAME: its better to precise branch name and make it short

7 BE CONSISTANCY: after choosing one or more convention its better to stick on it along project.

Top comments (0)