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:
mainis production, only release code lands theredevelopis 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
mainin Gitflow - they always return to
develop mainstays a purely production branch
Short answer for an interview
In Gitflow, feature branches are created from the
developbranch, because it reflects the current state of development, whilemainis intended only for production code.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.