Git Work Flow Architecture

A.T.M Ruhul Amin
2 min readSep 18, 2022

--

Git Branching/Git Work Flow to manage proper Branching

Git Work Flow Architecture is ideally suited for projects that have a scheduled release cycle. Actually, Git workflows are nothing special. They are just a documented branching and integration strategy teams can adhere to in order to allow lots of people to work on a project together seamlessly.

Here I have shared the process and branching structure that I maintain for my projects.

Structure of Branch Name :

  1. Feature (Create a branch for each feature like User Management, Project management)
  2. Dev (Serves as an integration branch for features)
  3. Release (Create a branch for each release, it can be multiple features or per Sprint wise delivery feature)
  4. Master (Master branch stores the official release history. Only the Latest version code will be there)
  5. Hotfix (Create a branch, if any minor change like field name, label name, or any bug arises from the production server)

Process/Flow :

  1. Developer pull the latest code from the Dev branch
  2. Create a New Feature Branch (ex: user management)
  • Developers work locally and Push/Pull and commit to featuring branches based on each feature
  • Completed task/feature, tested and resolved all issues for this feature.
  • Merge the feature branch into the dev branch.
  • Delete feature branch.

3. Create a New release branch by forking the Dev branch ( Ex: release 2.1 — created by any senior developer)

  • Deployed to a staging server for QA testing
  • Bug resolved changes or commits to releasing branch.
  • Deployed the latest code in the staging server.
  • Merged into dev branch and as well as the master branch
  • Delete release branch

4. Master branch :

  • The Master branch has the latest code. Now need to tag with a version number in the master branch (ex: 2.1) git tag -a v2.1 -m “my release 2.1”
  • Deployed to production server

5. Create a new Hotfix branch by forking the master branch:

  • Changes, resolve, tested, and commit to the hotfix branch
  • Once tested, must be merged into the master and dev branch
  • Tagged again with a version number (ex: 2.2) git tag -a v2.2 -m “release 2.2 bugs resolved”
  • Deployed to production server
  • Delete Hotfix branch

Summary:

  1. The Master branch is the rolled-out production code with tagged versions. It means it’s a final version of your Production Deployment.
  2. Only hotfix and release branches get merged into master (Also dev branch if needed).
  3. Feature branches are merged into the dev branch.
  4. Only bug fixes, not new features, are merged into release branches. If the development of a new feature needs to continue, it is merged into the dev branch, not the release branch.

Resources :

  1. Git Setup & Configuration
  2. Git Cheatsheet
  3. Git Workflow Diagram

References :

Atlassian BitBucket — Gitflow Workflow

Vincent Driessen — A successful Git branching model

--

--

A.T.M Ruhul Amin
A.T.M Ruhul Amin

Written by A.T.M Ruhul Amin

Tech Lead | Java | Spring Boot | Python | React | Angular | Serverless | AWS Certified | AWS Community Builder | GitHub Link : https://github.com/ruhulmus