Hot it Works

What Is Gitflow?

Gitflow is a branching model for Git, created by Vincent Driessen. It has attracted a lot of attention because it is very well suited to collaboration and scaling the development team.

How It Works

Feature Branches

New development (new features, non-emergency bug fixes) are built in feature branches:

Feature branches are branched off of the develop branch, and finished features and fixes are merged back into the develop branch when they're ready for release:

Release Branch

When it is time to make a release, a release branch is created off of develop:

The code in the release branch is deployed onto a suitable test environment, tested, and any problems are fixed directly in the release branch. This deploy -> test -> fix -> redeploy -> retest cycle continues until you're happy that the release is good enough to release to customers.

When the release is finished, we generate CHANGELOG.md using tools like git-chglog from commits.

Then, the release branch is merged into master and into develop too, to make sure that any changes made in the release branch aren't accidentally lost by new development.

Master Branch

The master branch tracks released code only. The only commits to master are merges from release branches and hotfix branches.

Hotfix Branches

Hotfix branches are used to create emergency fixes:

  • Hotfixes arise from the necessity to act immediately upon an undesired state of a live production version

  • May be branched off from the corresponding tag on the master branch that marks the production version.

They are branched directly from a tagged release in the master branch, and when finished are merged back into both master and develop to make sure that the hotfix isn't accidentally lost when the next regular release occurs.

Reference

Last updated