| Gitflow | GitHub Flow | Trunk-based | GitLab Flow | |
|---|---|---|---|---|
| Long-lived branches | main, develop | main | main (trunk) | main + environment or release branches |
| Short-lived branches | feature, release, hotfix | feature | very short feature (≤ 1–2 days) or none | feature |
| Release = | a tagged version | a deploy of main | a deploy of trunk | promotion through environments |
| Ceremony | High | Low | Lowest (needs discipline) | Medium |
| Needs | Release manager habits | CI + quick reviews | Strong CI, feature flags | Defined environments |
| Best for | Apps, libraries, on-prem | SaaS & web apps | Fast, experienced teams | Staged deployments, regulated envs |
Gitflow
Separate branches for features, releases and hotfixes, with develop as the integration branch. Structured and predictable. Full explanation →
GitHub Flow
One rule: main is always deployable. Branch from main, open a pull request, get review and green CI, merge, deploy. No develop, no release branches.
git switch -c fix-signup main
# commit, push, open PR → review → merge → deployTrunk-based development
Everyone integrates into the trunk (main) at least daily, either directly or through tiny branches that live for hours. Unfinished work hides behind feature flags, not branches. This needs excellent automated tests, but it nearly removes merge pain.
GitLab Flow
GitHub Flow plus branches that reflect where code is deployed (for example main → staging → production), or release branches like 2-3-stable for versioned software. Changes flow "downstream" by merging or cherry-picking.
How to choose
- Do users install a version? (mobile, desktop, library, on-prem) → Gitflow, or GitLab Flow with release branches.
- Do you deploy a web app whenever something merges? → GitHub Flow.
- Is CI strong, are feature flags in place, and do you want to merge many times a day? → Trunk-based.
- Must code pass through staging or pre-prod before production? → GitLab Flow (environment branches).
Start simple. It's easier to add a release branch when you need one than to remove ceremony your team has grown used to.