1 / 2 · Book 17 · Branching Strategies · drill: interview Q&A⊞ allnext →Get the book →
1.4GitHub Flow in Detail
GitHub Flow, popularized by GitHub itself, uses a single main branch. All work happens on feature branches that merge via pull requests. There are no develop or release branches.
main ──────*──*──*──*──*──*──*──*──*──── (always deployable)
^ ^ ^ ^ ^ ^ ^ ^ ^
PRs from feature branches
How GitHub Flow Works
mainis always deployable. If something is onmain, it is production-ready.- Feature branches branch from
main, contain all work, and merge back via pull request. - Pull requests are the primary quality gate. CI runs all tests on the PR before merge.
- Deploy from
mainafter merge. Many teams deploy automatically on every merge.
Implications for Testing
- Test on PR: Every pull request triggers the full test suite. This is your primary quality gate.
- Main is always deployable: If tests pass on the PR and the PR is merged,
mainshould be safe to deploy at any time. - No stabilization phase: There is no release branch. If something is broken on
main, fix it with another PR. - Simpler environment mapping: Feature branches deploy to preview environments,
maindeploys to production.
When to Use GitHub Flow
- Your team does continuous deployment (deploy multiple times per day).
- You have a single version in production (typical for SaaS).
- Your CI pipeline is fast and reliable enough to gate PRs effectively.
- Your team is small to medium and does not need the structure of GitFlow.
Common Mistake: Treating
mainas a "development branch" where broken code is acceptable. In GitHub Flow,mainmust always be deployable. If your tests do not run on every PR, GitHub Flow will burn you.