Which Git branching model fits a team deploying to production several times a day, and why?
answer
- Ask how many versions run in production at once
- What would develop be holding at this cadence
- Branch lifetime drives merge-base distance
- Tags can mark versions without branches
- The heavier model fits shipped, versioned software
basics
~20 sA single long-lived main with short topic branches, GitHub Flow style. At that cadence a develop branch is never meaningfully ahead of main, so it adds a second merge and a second place for fixes to be missing without buying any stabilization window.
solid answer
~50 sPick the single-main shape. Git Flow's `develop` exists to hold work that is finished but not yet released; if you release several times a day, `develop` is at most hours ahead of `main`, so the second integration point buys nothing and costs a second merge plus the standing risk that a hotfix lands on one permanent branch and not the other. Release branches would be cut and deleted within a day, which is ceremony without a stabilization window. Keep branches short so each merge base stays close to `origin/main` and conflicts stay small. The decision variable is not team size or taste — it is how many versions run in production at once. One version means one long-lived branch; several supported versions in the field mean you genuinely need a branch per line, and Git Flow or GitLab Flow's release-branch variant earns its cost.
code
console · 9 lines$ git rev-list --left-right --count main...develop
0 3
$ git for-each-ref --sort=-committerdate \
--format='%(committerdate:short) %(refname:short)' refs/heads/
2026-08-19 main
2026-08-19 develop
2026-08-18 feature/cart-badge
2026-05-02 feature/old-redesigngo deeper
Know that continuously deployed services usually keep one long-lived branch and short topic branches, while shipped, versioned products keep more structure.
Explain the mechanics: why branch lifetime drives merge-base distance and conflict size, and what develop would actually be holding at a daily cadence.
Demonstrate judgment by naming the deciding property — how many versions are live — and stating explicitly what you trade away, rather than declaring a model universally better.
Own the migration and the exception: know when a product's shape has changed enough to justify moving models, and defend keeping a heavier model where several supported versions genuinely exist.
## The question behind the question An interviewer asking this is not testing whether you can recite branch names. They want to see that you pick a branching model from a property of the product, and that you can say what the Git-level cost of the wrong choice is. ## The variable that decides it The deciding property is **how many versions of the software are live at once**, which follows from the deploy model. If you operate the software yourself and there is exactly one production version at any moment, there is exactly one line of history that needs to exist forever. Everything else is a temporary branch. If customers run copies of your software and several released versions are supported simultaneously, you need somewhere to keep committing per version — a branch per release line. That is a structural need no tag can satisfy, and it is what Git Flow and GitLab Flow's release-branch variant provide. Release cadence is the second variable. Discrete, scheduled releases give a stabilization period a release branch can occupy. Continuous deployment has no such period. ## Several deploys a day: what the models cost At that cadence, walk through Git Flow's branch set and ask what each one is holding. `develop` holds work that is finished but unreleased. If you release hourly, that set is nearly empty. What you get instead is a second permanent branch that can diverge from `main`, and every fix that must exist on both has to be merged twice. The classic incident — a hotfix merged into `main` but forgotten on `develop`, reintroduced by the next release — is a pure tax with no matching benefit. A release branch holds stabilization commits while feature work continues on `develop`. Cut and deleted the same day, it holds nothing; the parallel feature work it protects against amounts to a few hours. A hotfix branch exists so a production patch can avoid unreleased work. If `main` is deployed continuously, there is no unreleased work to avoid; the fix is just another short topic branch. So the answer is a single long-lived `main`, with short-lived branches created from its tip and merged straight back — the GitHub Flow shape. ## Why short branches are the operative part A three-way merge diffs both sides against their merge base. The further back the merge base, the more unrelated change is in each diff and the more likely two edits collide. Branch lifetime is therefore the main input to conflict pain, and it is the thing this model actually controls: cut from `origin/main`, merge back within a day or two, bring `main` in while you work. The divergence is measurable rather than a matter of opinion. `git rev-list --left-right --count main...develop` prints how many commits each side has that the other lacks. If that number is small and stays small, the second branch is not doing anything. `git for-each-ref --sort=-committerdate refs/heads/` shows how stale the branch tips are, which tells you whether "short-lived" is true in practice or only in the team's self-description. ## Where the heavier models still win A library, a desktop application, an on-premises product: users are on 2.3 while you are building 3.0, and 2.3 needs a patch. You need a branch sitting on the 2.3 line. Cut it once and keep it; that is Git Flow's release branch, or the per-version branch of GitLab Flow's release variant. A gated deploy pipeline, where staging deliberately lags production or a promotion is a manual decision, is the case for GitLab Flow's environment branches: the branch encodes real information about where code is running. ## What marks a release without a branch If you drop release branches you still need to name versions. An annotated tag on a commit of `main` does that, and `git describe` then expresses any later commit relative to the nearest tag. The information is preserved; only the structure is dropped. ## How to answer without sounding dogmatic Name the model, name the property that decided it, and name what you gave up. "Single main with short branches, because we run one version and deploy continuously — which means we lose the stabilization window a release branch would give us, and we pay for that with the discipline of keeping main deployable." That is a judgment, not a preference, and it is what the level is being tested for. The strongest supporting fact you can cite: the author of Git Flow later appended a note to the original article steering continuously delivered web applications toward simpler models, while standing behind it for versioned, shipped software. The model was never wrong; it was designed for a different release shape.
- Is there any Git-level reason a team deploying hourly might still keep a second long-lived branch?Only if that branch encodes something real that main cannot: a deliberately lagging environment, or a version other people still run. If it exists merely as a staging area for finished work, it is a second history that fixes must be applied to twice, and the divergence count will show it hovering near zero.
- How would you check whether a repository's branching model matches what the team says it does?Look at the evidence in the refs. `git rev-list --left-right --count main...develop` shows whether the second branch is really ahead. `git for-each-ref --sort=-committerdate refs/heads/` shows how old branch tips are. A repository full of month-old branches is not running a short-lived-branch model, whatever the wiki says.
- What do you actually give up by dropping release branches?A place to stabilize while new work continues, and a structural record of which commits belong to which version. The second is replaceable by annotated tags plus `git describe`. The first is only a loss if there is a stabilization period at all — with continuous deployment there is none to protect.
saying these in an interview costs you the question
- Says Git Flow is simply outdated and always wrong
- Picks a model by team size rather than deploy model
- Thinks a develop branch reduces merge conflicts
- Assumes dropping release branches loses version history
- Keeps long-lived branches then blames Git for conflicts