CurriculumTeam WorkflowsGitFlow Workflow
Lesson 1 of 520%
Advanced10 min+100 XP

GitFlow Workflow

GitFlow is a structured branching model for teams that ship software on a defined schedule. It uses multiple long-lived branches with strict rules about what merges where. Dominant for a decade in enterprise and mobile development.

01.The Five Branch Types

Permanent branches: main (always production-ready, tagged on releases), develop (integration branch where features merge). Temporary branches: feature/* (branch off develop, merge back to develop), release/* (branch off develop for final prep — bugfixes only, merges to both main and develop), hotfix/* (branch off main for emergency fixes, merges to main and develop).

Branch Visualization
featuremainHEAD
main
feature
HEAD

02.GitFlow: Pros and Cons

Pros: clear isolation between production and development, supports multiple version maintenance, well-suited for scheduled releases and mobile apps. Cons: complex with many long-lived branches, merge conflicts accumulate, slow release cycle, overhead for most web projects. Best for: versioned libraries, mobile apps, enterprise software with defined release windows. Not recommended for: web apps with continuous deployment.

Commit Timeline
a1b2c3d
init
b2c3d4e
feat
c3d4e5f
fix
d4e5f6a
HEAD

Commands

commands — click to reveal output
$
git checkout -b develop main
Create the permanent develop integration branch
$
git checkout -b feature/user-auth develop
Start a feature from develop (never from main)
$
git checkout develop && git merge --no-ff feature/user-auth
Merge feature back to develop (always with --no-ff)
$
git branch -d feature/user-auth
Delete the feature branch after merge
$
git checkout -b release/1.2.0 develop
Start a release branch from develop
$
git checkout main && git merge --no-ff release/1.2.0
Merge release to main when ready to ship
$
git tag -a v1.2.0 -m "Release 1.2.0"
Tag the release on main
$
git checkout develop && git merge --no-ff release/1.2.0
Also merge release back to develop (sync any last-minute fixes)
KNOWLEDGE CHECK

In GitFlow, where should feature branches merge to?

Rate this lesson:
PreviousNext Lesson