The purpose and considerations of each branch of the GitFlow workflow

I. Main branches

  • Master
  • Develop
  • Feature
  • Release
  • HostFix

Ii. Work flow

Three. Matters needing attention

I. Main branches

Master
  • Master branch. After all functions of the product are realized, it will be released to the public in master branch.
  • This branch is read-only and unique

Can only be merged from other branches (release/hotfix), cannot be modified in this branch

Develop
  • Master branch Development branch, based on the master clone branch.
  • Contains all the code to be released to the next release.
  • This branch is read-only and unique and can only be merged from other branches
  • The feature branch is complete and merged into develop.
  • Develop pull release branch
  • Once the Release /hotfix branch is live, merge it into Develop and push it
Feature
  • Function development branch, based on the Develop branch clone, mainly used for the development of new requirements and features
Release
  • Test the branch, merge it into Develop based on the feature branch, and clone it from develop
  • Bugs found during testing will be fixed in the Develop/Master branch. After the bugs are fixed, they will be merged into the Develop/Master branch and pushed (functionality completed)
HostFix
  • Patch branch, based on the master branch clone, is mainly used to fix bugs in online versions
  • Once the fix is done, merge it into the Develop/Master branch and push it, then Tag it
  • It is a temporary branch and can be deleted after patch repair goes online
  • All hotfix branch changes go into the next release

I. Work flow

(Figure from network)

Three. Matters needing attention

  • The feature can be merged into develop, optionally deleting the current feature or not, but the current feature cannot be changed and must be coded from the Release branch.
  • After the merge, you can delete the current hostfix. If you do not delete the current hostfix, the current hostfix cannot be modified. If the patch is not fixed, you need to pull the new hostfix from the master to modify the patch.
  • When you make a release branch, if the Develop branch changes, as other developers finish features and go live, you need to merge those features into your own branch.