What is the main idea of Gitflow?
The main idea of Gitflow is to split development, release preparation, and production code across different branches, so the release process is strictly managed and predictable.
In simpler terms: "Every stage of a code's life has its own branch and clear rules."
The key concept of Gitflow
Gitflow has permanent branches and temporary branches, each with its own role.
Permanent branches
maincontains only production code, every commit is a releasedevelopis the main development branch, everything new lands here first
Temporary branches
feature/*for developing new featuresrelease/*for preparing a releasehotfix/*for urgent production fixes
How this works overall
- New features are built in
feature/*off ofdevelop - Features are merged back into
develop - When it is time to ship a version, a
release/*branch is created - Only bugs and release metadata are fixed in
release/* - The release is merged into
main(production) - Changes from the release are merged back into
develop - Urgent bugs in production are fixed via
hotfix/*off ofmain
The essence of Gitflow (in short)
- a clear separation of development stages
- a stable
main - active development in
develop - releases and hotfixes are isolated
- multiple versions are easy to maintain
Why Gitflow is needed at all
Gitflow solves the problems of:
- complex releases
- long version preparation
- maintaining production and development in parallel
- strict processes in large teams
When Gitflow fits
Gitflow works well when:
- releases are rare and planned
- the project is large
- strict stability matters
- there are separate release cycles
When Gitflow does not fit
Gitflow is excessive when:
- the team is small
- releases are frequent
- CI/CD and continuous delivery are in use
- iterations are fast
Short answer for an interview
The main idea of Gitflow is to separate development, releases, and production using dedicated branches (
develop,main,feature,release,hotfix), making the code release process managed and predictable.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.