Git Branching Work Flow for individual and independent functionality deployment

Ever stuck in a scenario where you want a hotfix or need an individual functionality deployed on production? Parallel Git Branching does not work here!!

No worries... You are at the right place to get a solution to it.

For those who are unaware of the general Git Branching workflow, let's have a brief about it.

The Git Flow is the most known workflow on this list. It was created by Vincent Driessen in 2010 and it is based on two main branches with an infinite lifetime: Develop and Master.

General Git Branching Flow has the following branches and workflow :

  • develop-* — This branch is used for development purposes only. Developers merge their pre-production code into develop branch and use it for testing purposes.
  • stage-* — This branch supports the preparation of a new production release. They allow many minor bugs to be fixed and preparation of meta-data for a release.
  • master-* — This branch contains production code. All development code is merged into master.

General Flow :

  1. Developer creates an epic branch from “develop”. Once pre-production code is generated, he/she moves the epic branch code into the “develop” branch.
  2. Once testing on develop branch is done, it stages its code to the “stage” branch for quality assurance.
  3. After the test cases are passed, the code is pushed to the “master” branch for production release.

The major drawback of the above workflow is, we cannot move any particular feature to production unless all the features pushed to the stage branch are tested.

In this case, the developer has to wait for all its stage code to pass all the tests. But imagine if you need to do a hotfix or your boss says you to release a single feature to production on the head.

What now?

I got your back!!!! Let's look at a great git branching flow for adding any individual feature to production without any dependency on other code.

Git Branching Work Flow for individual and independent functionality deployment :

  1. Create your epic branch from the master branch.
  2. After the developer has done adding an individual feature to their epic branch merge your epic branch to develop and test it.
  3. Once tested, merge your epic branch to stage as well for quality assurance
  4. After all the test cases pass on the stage branch, merge your epic branch with a particular feature to the master branch for production release.

Hooray!!! It's done and dusted.

Independent feature deployment Git Branching Work Flow in Detail and Stepwise

Every step is explained in detail for the production release of an individual feature independently with all necessary steps and commands in the below-given flow chart.

Git Branching Work Flow

I hope this helps you save time while reducing the dependency of deployment of features while working with Git. :)

Did I get something wrong? Mention it in the comments. I would love to improve.

If you learned even a thing or two, clap your hands 👏 as many times as you can to show your support! This motivates me to write more.

“Hit👏 for Git” 🙌🏼

Image Source: Google Images

Senior Software Engineer