Git Flow
In one line
Git Flow is a branching model with dedicated branches for features, releases, and hotfixes, providing a structured workflow for releases.
In simple words
Git Flow is a branching model proposed by Vincent Driessen that defines specific branch types and rules for how they interact. It provides a structured workflow for projects with scheduled releases.
The branch types in Git Flow:
- main: production-ready code, always deployable. Tagged with version numbers.
- develop: integration branch for features. Latest delivered development changes.
- feature/*: branches off develop for new features. Merged back into develop.
- release/*: branches off develop for release preparation. Merged into both main and develop.
- hotfix/*: branches off main for urgent production fixes. Merged into both main and develop.
Git Flow provides clear structure but can be heavyweight for small teams or continuous deployment. Simpler alternatives include GitHub Flow (feature branches + PRs to main) and Trunk-Based Development (everyone commits to main with short-lived branches).
Example
# Using the git-flow extension (if installed)
git flow init
git flow feature start login
git flow feature finish login
git flow release start 1.0.0
git flow release finish 1.0.0
# Or manually:
git checkout -b feature/login develop
# ... develop feature ...
git checkout develop
git merge --no-ff feature/login
git branch -d feature/loginGit Flow uses structured branch types: main, develop, feature, release, hotfix.
Related terms
Related Resources
Related Lessons
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.