Release branchA branch that stabilizes a specific version. You branch from a known-good commit before risky features landed. Only critical bug fixes are cherry-picked in.
Cherry-pick into releaseNew features on main are too risky for a release. Use git cherry-pick <hash> to pick only the specific bug fix commits, ignoring later feature commits.
Push branch and tagAfter tagging, push both the branch (git push origin release/v1.0) and the tag (git push origin v1.0.0). Tags are not pushed automatically with branches.
📖 Story
Your team has been busy: 2 new features (dashboard, API refactor) and a critical bug fix were pushed to origin/main. You need to ship v1.0 with the bug fix but WITHOUT the unfinished features.
You'll create a release branch from the last stable commit (before the fix and features), cherry-pick only the fix, tag the release, and push both the branch and the tag.
Then you'll sync main, merge the fix back, and push cleanly.
This is the standard release branch workflow used to stabilize a version without blocking ongoing development.
View the current state
Run git log --oneline. Main has 3 commits. The remote has 3 more: a bug fix (r4d5e6f) and two risky features (dashboard, API refactor). We need only the fix for the release.
● View the current state
○ Fetch the remote commits
○ Branch from the stable commit
○ Cherry-pick only the bug fix
○ Tag the release
○ Push the release branch
○ Push the tag
○ Switch back to main
○ Pull the latest main
○ Merge the release fix into main
○ Push main
Terminal
📘 Starting tutorial: Release Branch Workflow
Stabilize a release: fetch, branch from a stable point, cherry-pick only the fix, tag, push, merge back