GitHub Flow is an ideal workflow for teams that deploy frequently and want to iterate quickly without the overhead of long release cycles or complex branching strategies. It keeps the process simple and fast, enabling continuous integration and deployment, which helps catch issues early and deliver features to users rapidly.
These are the basic rules of the workflow:
mainis always deployable
The main branch must be stable and ready to deploy at all times. Never push untested or broken code.
- Create descriptively named branches from
main
Start every new feature, fix, or idea in a new branch based on main, with clear and meaningful names.
- Push to your branch often
Push work regularly to the remote to back it up, share progress, and trigger CI.
- Open a Pull Request early
Use pull requests for code review, discussion, or help—long before the branch is “done.”
- Get reviewed and approved before merging
Don’t merge until someone reviews and approves your work (even with just a 👍 or :shipit:).
- Deploy right after merging to
main
Once merged, deploy immediately or soon—everything in main should be safe and shippable.
This flow emphasizes simplicity, speed, and collaboration, especially for teams that deploy frequently.
-
If you plan to make a release immediately after merging, bump the version directly in your feature branch. This avoids the need to create a separate release branch just for the version bump.
-
Always rebase feature branches on top of
mainbefore merging them. This, combined with enforcing merge commits in GitHub repository settings, results in a semi-linear history on themainbranch, which is very helpful when usinggit log.1 If merge commits are not enforced, Git will perform a fast-forward merge after rebasing, creating a linear history and losing the context of the feature branch. If merging locally, avoid fast-forward merges with:git checkout main git pull git merge branch_name --no-ff
Footnotes
-
When performing a rebase, it's acceptable to
push --forceto your own feature branch, but never on shared branches. Protectmainand/ordevelopfrom force pushes via GitHub settings. ↩