When would you choose GitFlow over trunk-based development?
IntermediateScenarioBranching Strategies and Releases
Answer
Situation read → The right model depends on how software is shipped.
What I'd do →
- GitFlow fits scheduled releases and several supported versions: mobile apps, on-prem or packaged software.
- Trunk-based fits SaaS with continuous deployment.
- If we adopt GitFlow, keep it light:
main,develop, shortrelease/*andhotfix/*branches, and skip long feature branches. - Automate merge-back from release and hotfix branches to avoid divergence.
Why → GitFlow's overhead pays off only when you must maintain parallel release lines.
Interview tip → Show you know the author of GitFlow himself said it is a poor fit for continuously delivered web apps.
More on Branching Strategies and Releases
An eight-person team deploys several times a day. Which branching strategy do you recommend?IntermediateIn trunk-based development, a feature will take three weeks. How do you merge it daily without exposing it?IntermediateYou are cutting a release. How do you manage the release branch and late fixes?IntermediateShould releases use lightweight or annotated tags?BeginnerA release tag was placed on the wrong commit and has been published. What do you do?IntermediateProduction has a bug, but `main` already contains unreleased features. How do you ship a hotfix?Intermediate