/
Git Branching Model

Git Branching Model

What is the purpose of the Article?

  • You will understand concepts related to branching in Gitlab

  • You will understand the branching flow followed in Eshopbox

Audience

  • Software Development Engineers

Introduction

Coding in branches is a simple practice that keeps you and your work more organized. Branches let you easily maintain your “in-progress” work separately from your completed, tested, and stable code. Not only is this an effective way to collaborate with others, but it will also allow you to automate the deployment of updates and fixes to your servers.

Branches

There are six types of branches used in Eshopbox;

  • Master

  • Staging

  • Stable

  • Version

  • Feature

  • Work in Progress

Master

  • Is the branch from which deployment to the production environment is done

  • It is a protected branch, i.e, only users with maintainer access can approve a merge request in the branch

  • This branch must never be deleted

  • There is no branch to be created from this branch unless there is a critical bug in the production environment

Stable

  • This branch is a replica of the master branch, to be used as a fail-over for master branch

  • All new version branches are to be created from this branch

  • This branch must never be deleted

Staging

  • This branch is used for code testing purposes

  • Is the branch from which deployment to the staging environment is done

  • No branch is to be created from this branch unless there is a conflict during a merge request.

  • This branch must never be deleted

Version

  • This branch is created from Stable branch

  • This is the branch from which all feature branches are to be created

  • This branch will be merged with the Master branch at the month end to release the features completed over the month.

Feature

  • This branch is created from the Version branch

  • Each feature branch corresponds to a new User Story in Jira wherein a new User Story implies that it is a new feature to be developed. In the case that a new User Story is created for an existing feature, then you will not create a new feature branch.

Work in Progress(WIP)

  • This branch is created from the feature branch

  • This branch is used for managing your day-to-day code.

  • You are required to daily push at the end of the day to the feature branch and take a pull in the morning from the feature branch.

Naming Convention of branches

  • Name of Version branch: <Version-month_name-year>

    • Example: Version-September-2020

  • Name of feature branch: Feature/<feature_name>

    • Example: Feature/Test123

  • Name of WIP branch: WIP/<feature_name>/username

    • Example: WIP/Test123/akshay

Learn more about:

Glossary

WIP: Work In Progress

 

Related content