Skip to main content

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

  • main contains only production code, every commit is a release
  • develop is the main development branch, everything new lands here first

Temporary branches

  • feature/* for developing new features
  • release/* for preparing a release
  • hotfix/* for urgent production fixes

How this works overall

  1. New features are built in feature/* off of develop
  2. Features are merged back into develop
  3. When it is time to ship a version, a release/* branch is created
  4. Only bugs and release metadata are fixed in release/*
  5. The release is merged into main (production)
  6. Changes from the release are merged back into develop
  7. Urgent bugs in production are fixed via hotfix/* off of main

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 ready
Premium

A concise answer to help you respond confidently on this topic during an interview.