Git Workflow

Gitflow Workflow is a Git workflow that helps with continuous software development and implementing DevOps practices. Gitflow Workflow defines a strict branching model designed around the project release. This provides a robust framework for managing larger projects.
How it works
Develop and Main Branches

Instead of a single main
branch, this workflow uses two branches to record the history of the project. The main
branch stores the official release history, and the develop
branch serves as an integration branch for features.
Feature Branches
Each new feature should reside in its own branch, which can be pushed to the central repository for backup/collaboration. But, instead of branching off of main
, feature
branches use develop
as their parent branch. When a feature is complete, it gets merged back into develop. Features should never interact directly with main
.

Release Branches
Once develop
has acquired enough features for a release (or a predetermined release date is approaching), 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 main
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 main
instead of develop
. This is the only branch that should fork directly off of main
.
