GitHub Flow
In this page:
What is GitHub Flow
GitHub Flow is a lightweight branching model built around a single long-lived main branch and short-lived feature branches -- unlike GitFlow's multiple permanent branches (develop, release, hotfix), GitHub Flow deliberately keeps only one permanent branch to minimize process overhead for teams that deploy continuously.
Example: What is GitHub Flow
git checkout main
git checkout -b add-search
Branch From Main
Every piece of work -- a feature, a fix, an experiment -- gets its own descriptively-named branch cut directly from main, with no intermediate develop branch to merge through first.
Example: Branch From Main
git checkout main
git checkout -b fix-header-bug
Open a Pull Request Early
GitHub Flow encourages opening a pull request as soon as a branch exists, even before the work is complete -- the PR becomes a running conversation thread for feedback, CI results, and progress visibility, not just a final review gate.
Example: Open a Pull Request Early
git push -u origin fix-header-bug
# open a pull request immediately, even before work is complete
Merge and Deploy
Once a pull request is reviewed and its checks pass, it's merged directly into main -- and because main is meant to always be deployable in this model, that merge is typically followed immediately by an automatic or one-click deployment to production.
Example: Merge and Deploy
git checkout main
git merge fix-header-bug
git push origin main
GitHub Flow vs GitFlow
GitHub Flow trades GitFlow's structured release/hotfix branches for simplicity: there's no separate develop branch to keep in sync, and no scheduled release branch -- every merge to main is a potential deploy, which suits teams practicing continuous delivery far better than GitFlow's more deliberate, versioned release cadence.
Example: GitHub Flow vs GitFlow
git checkout -b feature-x main
# merges straight to main, no develop branch
Chapter Quiz — Complete all 9 topics to unlock
0/9 topics done
Complete these topics first: