If your repo looks like a reality show where branches fight for screen time, Gitflow can help. This guide shows how to apply the Gitflow branching model on GitHub with practical commands and pull request practices that actually keep things readable and releasable.
Pick main
as your production branch and develop
as the integration branch. You can let git flow init
do the polite ritual, or create the branches by hand with
git checkout -b develop
git push -u origin develop
On GitHub enable branch protection for both main
and develop
so nobody can push heartbreak directly. Require status checks, require reviews, and enable required CI for pull requests.
Create one feature branch per task and give it a helpful name, not a cryptic rant about your day. Example names work well like feature/add-login
or feature/payment-intent
. Using feature branches keeps work isolated, makes code review simple, and makes rollbacks less dramatic.
git checkout -b feature/name
and push it with git push -u origin feature/name
develop
and require at least one review and passing CI checks before mergingWhen develop
is stable and ready for staging create a release branch named like release/1.2.0
. Use that branch to bump version numbers, run final tests, and perform any last minute polishing. Finalize the release by merging the release branch into main
and into develop
so no fixes are lost.
git checkout -b release/1.2.0 develop
# bump version and test
git checkout main
git merge --no-ff release/1.2.0
git tag v1.2.0
git push origin main
git push origin --tags
Tagging the main
commit with a version tag like v1.2.0
keeps your release history searchable and useful for rollbacks.
When production breaks and someone yells your name, create a hotfix branch from main
such as hotfix/1.2.1
. Apply the fix, merge the hotfix into main
and into develop
so the fix survives in future releases, then tag and push.
git checkout -b hotfix/1.2.1 main
# fix the bug
git checkout main
git merge --no-ff hotfix/1.2.1
git tag v1.2.1
git push origin main
git push origin --tags
git checkout develop
git merge hotfix/1.2.1
git push origin develop
main
and develop
with required reviews and CI checksdevelop
to avoid divergent historyvMAJOR.MINOR.PATCH
for traceable versioningGitflow on GitHub is not a magic spell, but when paired with branch protections, CI, and sensible naming it keeps teams sane and releases predictable. Use it to bring order to your branching chaos and to avoid surprise fire drills on Friday night.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.