-
Couldn't load subscription status.
- Fork 2
FAQ: Release Engineers: Performing a release with git flow
Ulrond edited this page Dec 16, 2024
·
4 revisions
Git Flow provides a structured branching model for managing software releases. Here's how you can use it to create a fixed tag release:
- Use
git flow release start <release-name>(e.g.,git flow release start 1.2.0) - This creates a new branch (e.g.,
release/1.2.0) from thedevelopbranch.
- This branch is dedicated to finalizing the release, fixing bugs, and preparing release notes.
- Do not add new features here; those should be targeted to
developfor the next release.
- When the release is ready, use
git flow release finish <release-name>, (note:<release-nameis optional) - This performs several actions:
- Merges
release/1.2.0intomain - Tags the
maincommit with the release name (e.g.,1.2.0) - Merges
release/1.2.0back intodevelopto keep it up-to-date - Deletes the
release/1.2.0branch
- Merges
- Assuming your default remote is
origin, and you're onmainbranch- Use
git push --tagsto push the tag andmainbranch to your remote repository. - Use
git checkout developto check out the develop branch - Use
git pushto push the develop branch
- Use
# Start the release
git flow release start 1.2.0
# Work on the release (fix bugs, update docs, etc.)
# ...
## Generate a change log see (https://github.com/cookpete/auto-changelog)
autochange-log -v 1.2.0
git add CHANGELOG.md
git commit -m "Bumped CHANGELOG.md for release"
# Finish the release
git flow release finish 1.2.0
# Code should be merged to both develop & main
# If successful & not merge errors the branch will be `develop`
# If merge errors, follow instructions and re-run etc.
# Merge has occurred to develop
git push # pushes develop
git push --tags # pushes the tags
git checkout main # swaps branch to main
git push # pushes main- Clear Structure: Provides a well-defined workflow for managing releases.
-
Dedicated Branch: The
releasebranch isolates release-related work from ongoing development. - Version Tracking: Tags make it easy to identify and roll back to specific releases.
- Automation: Git Flow commands automate the merging and tagging process.
-
Hotfixes: Use
git flow hotfixto quickly address critical issues in production releases. -
Support Branches: Use
git flow supportto maintain older releases.
By following this approach, you can streamline your release process, ensure consistent versioning, and maintain a clean Git history.
Refer also to FAQ: Git-Flow: Developers Branching Model