Gitflow Workflow
Gitflow Workflow is a Git workflow design that was first published and made popular by Vincent Driessen @nvie.
The Gitflow Workflow defines a strict branching model designed around the project release. This provides a robust framework for managing larger projects.
Gitflow is ideally suited for projects that have a scheduled release cycle. This workflow doesn’t add any new concepts or commands beyond what’s required for the Feature Branch Workflow. Instead, it assigns very specific roles to different branches and defines how and when they should interact.
Develop and Master Branches
Instead of a single master branch, this workflow uses two branches to record the history of the project.
- The master branch stores the official release history.
- The develop branch serves as an integration branch for features.
It is also convenient to tag all commits in the master branch with a version number.
Feature Branches
Each new feature should reside in its own branch, which can be pushed to the central repository for backup or collaboration. But instead of branching off master, feature branches use develop as their parent branch. Features should never interact directly with master.
Release Branches
Once develop has acquired enough features for a release, you fork a release branch off of develop. Creating this branch starts the next release cycle, so no new features can be added after this point—only bug fixes, documentation generation, and other release-oriented tasks should go in this branch. Once it's ready to ship, the release branch gets merged into master and tagged with a version number. In addition, it should be merged back into develop, which may have progressed since the release was initiated.
Hotfix Branches
Maintenance or hotfix branches are used to quickly patch production releases. Hotfix branches are a lot like release branches and feature branches except they're based on master instead of develop.