Course contentsShow
← Software Engineering
Lesson 84 of 1,9332. Version Control with GitFree lesson

Git Flow: Feature, Develop, Release, and Hotfix Branches

Understanding Git Flow's structured approach with dedicated branch types for features, releases, and production hotfixes.

Git Flow: Feature, Develop, Release, and Hotfix Branches

What you'll learn: You'll understand how Git Flow organizes work into specialized branch types for different stages of development.

The Core Idea

Git Flow is a structured branching strategy that uses five types of branches, each with a specific role. Unlike trunk-based development (which keeps everything close to one main branch), Git Flow separates work into distinct streams:

  1. main (or master) — production-ready code only
  2. develop — the integration branch where features come together
  3. feature/* branches — where you build new functionality (branched from develop)
  4. release/* branches — for final testing and polish before production (branched from develop)
  5. hotfix/* branches — for emergency fixes to production (branched from main)

How It Works

Think of Git Flow like a factory assembly line with quality gates:

  • Feature branches let developers work in isolation without breaking the integration branch
  • When ready, features merge into develop — the "staging area" where everything comes together
  • When you're preparing a new version, create a release branch from develop for final bug fixes and version bumping
  • The release merges into both main (for deployment) and back to develop (to keep them in sync)
  • If production breaks, create a hotfix branch from main, fix it fast, then merge to both main and develop

This prevents half-finished features from accidentally reaching production while allowing emergency fixes to bypass the normal development cycle.

Git Flow works well for projects with scheduled releases and multiple versions in production simultaneously, though it's more complex than trunk-based development.

Key Takeaway: Git Flow uses dedicated branch types (feature, develop, release, hotfix) to separate active development from production-ready code, providing structure at the cost of increased complexity.