Contents
A branching model defines how code travels from a developer to a release. Git Flow, with long-lived develop and release branches, suits products with rare planned releases and several supported versions. Most web products are better served by trunk-based development: branches that live a day or two, frequent merges into main, automated tests on every change and flags for unfinished features.
Here is how the models differ, how they affect speed and conflicts and what you need to work with short-lived branches.
Which branching models are there?
The main models differ in the number of long-lived branches and how often code merges into main.
| Model | How it works | When it fits |
|---|---|---|
| Git Flow | main, develop, feature, release and hotfix branches | Rare releases, several supported versions |
| GitHub Flow | main plus short feature branches via pull requests | Web products with frequent releases |
| Trunk-based | Everything merges into main several times a day, flags for unfinished work | Mature CI, frequent releases, several teams |
| Release branches | main plus short branches while a version ships | Mobile apps, packaged products |
Why do long-lived branches slow development?
Long-lived branches accumulate divergence from the main code. The longer a branch lives, the more painful the merge conflicts, the later incompatibilities surface and the more changes land in a single risky release.
- conflicts — two weeks of isolated work becomes a day of resolving conflicts;
- late integration — incompatibility with others' changes appears only at merge time;
- large pull requests — hard and slow to review; see code review best practices;
- risky releases — many changes at once make it hard to tell what broke.
Photo: Unsplash
How do you work with short-lived branches?
Short-lived branches need three things: the ability to split tasks into small parts, reliable automated tests in CI and feature flags that hide unfinished work from users. Without them, frequent merges into main mean constant breakage.
git switch -c feature/checkout-address-validation
# a small, complete change, tests, commit
git push -u origin feature/checkout-address-validation
# pull request → CI → review → merge into main the same or next day
Team rules:
- A branch lives no longer than a day or two.
- Every merge into main passes CI and review.
- Main is always releasable.
- Unfinished features sit behind a disabled flag — see feature flags.
- Big changes are split into steps: preparation, new logic, switch-over, removal of the old code.
When is Git Flow still appropriate?
Git Flow fits when releases are rare and planned and several product versions are supported at once: packaged software, libraries, systems with mandatory customer acceptance testing. A separate release branch helps stabilise a version while development continues.
- packaged products and libraries supporting several versions;
- lengthy acceptance testing before every release;
- regulated industries with a formal release procedure.
For a web product releasing daily, Git Flow is usually overkill: develop becomes a second main and release branches add manual work.
How do you choose a model for your team?
Choose by release frequency and automation maturity. If CI is unreliable and tests are few, invest there first — otherwise no model will give fast, safe releases.
- a web product releasing several times a week — GitHub Flow or trunk-based;
- a mobile app — main plus short release branches;
- a packaged product with several versions — Git Flow or a simplified version of it;
- in every case — a protected main branch, mandatory CI and review.
More on pipelines and tests in CI/CD with GitHub Actions and automated testing strategy.
In short
- Git Flow means long-lived branches and planned releases; trunk-based means frequent merges into main.
- Long-lived branches accumulate conflicts and make releases risky.
- Short-lived branches need small tasks, reliable CI and feature flags.
- Git Flow fits packaged products with several versions.
- Web products are usually better off with GitHub Flow or trunk-based development.
FAQ
How long should a feature branch live?
Ideally no more than one or two days. If a task is bigger, split it into parts that can be merged separately, hiding unfinished work behind a flag.
What about mobile apps where releases go through store review?
A main branch plus short release branches works well: the release branch receives only fixes while the version is in review, and development continues on main.
Should direct commits to main be forbidden?
Yes, in most teams changes reach main only through a pull request that passes CI and review. This prevents accidental breakage and keeps a record of discussions.



