Git Flow

Git Flow is usually more complicated than GitHub flow. It is used when your software has the concept of “release”. This flow works perfectly when you work in a team of one or more developers and they collaborate on the same feature.

Main Branches in Git Flow

  • Master: Represent the production-ready state of code
  • Develop: Represents the latest development changes

Feature Branch

Whenever one has to work on a new feature, they branch off from the develop branch, work on the changes in the feature branch. Once the changes in the feature branch are completed, request a Pull request to the develop branch. Once the feature is reviewed and approved, these changes can be merged back to the development branch.

Release Branch

  • Release branches are branched off from the Develop and merged back to develop and master.
  • You need to perform the bug fixing pre-released code in this branch, bug fixes may be continuously merged back to the develop branch.
  • All features targeted for release should be merged back to develop the branch
  • You should create a new release branch with a name that reflects the new version number.
  • If the release branch is to be released on the production server, then merge the release branch into the master, create a tag for future reference, then merge back changes to develop branch and then delete the release branch.

HotFix Branch

  • HotFix branches are branched off from the Master and merged back to develop and master.
  • Fix the bug in the hotfix branch, when finished with bug fixing, merge the hotfix branch with master then create Tag for future reference and Merge changes back to develop branch. Lastly, Delete hotfix Branch.

From a CI/CD perspective, we only want to deploy the develop and master branches respectively. Develop branch should be sent to dev or test environments. The master branch ends up in production environments.


Git Flow vs Github Flow

There are basically two ways to manage the software projects in GIT Git flow and GitHub flow. These two flows can help you manage your project and optimize your entire workflow in the team.

Similar Reads

GitHub Flow

GitHub flow is really very simple to adapt as this flow doesn’t have releases because your deployment to production happens every day. There are two types of branches involved in this flow, the master branch, and the feature branch....

Git Flow

Git Flow is usually more complicated than GitHub flow. It is used when your software has the concept of “release”. This flow works perfectly when you work in a team of one or more developers and they collaborate on the same feature....