Skip to main content

Which branch is a feature branch created from in Gitflow?

In Gitflow, a feature branch is created from the branch develop.


Why develop specifically

In Gitflow:

  • main is production, only release code lands there
  • develop is the main development branch, where all upcoming changes are collected

So the logic is:

New features always start from the current state of development, not from production.


Typical example

bash
git checkout develop git checkout -b feature/login
  • the feature starts from develop
  • it is then developed in isolation
  • after it is finished it is merged back into develop

What is important to emphasize at an interview

  • feature branches are never created from main in Gitflow
  • they always return to develop
  • main stays a purely production branch

Short answer for an interview

In Gitflow, feature branches are created from the develop branch, because it reflects the current state of development, while main is intended only for production code.

Short Answer

Interview ready
Premium

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