GitFlow versioning workflow
This page is for the developer or lead who releases a project built from Vortex. It explains the git-flow branching model and walks you through a release from start to production, so you can run a release and check that it worked.
git-flow is a versioning workflow, first described in A successful Git branching model, with a branching model that keeps development code and production code apart:
- Work lands on
develop. mainholds only production-ready code.- A short-lived branch carries each feature, release and hotfix.
Vortex builds its defaults around these branch names: the CI triggers, the deployment branch patterns and the release notes workflow all expect them.
The following diagram shows a release from start to deployment:
develop ──► git flow release start X.Y.Z
│
▼
release/X.Y.Z
(final fixes, release notes)
│
▼
git flow release finish X.Y.Z
│
├──► merges into `main` and tags `X.Y.Z`
├──► merges back into `develop`
│
▼
deploy the `X.Y.Z` tag
(or push `main` to `production` for branch-based hosting)
Branch structure
git-flow uses the following branches:
develop- the development branch, where features are integratedmain- production-ready code, always stable and tagged with releasesfeature/*- a branch for each feature in developmentrelease/*- release preparation branches (for example,release/25.1.0)hotfix/*- emergency fixes for production (for example,hotfix/25.1.1)
production branch
When your hosting can deploy a specific Git tag, you tag releases on
main and deploy those tags, so no separate production branch is
needed.
Some providers, Lagoon among them, deploy only from a Git branch, and the
Vortex Lagoon deployment skips tags. On those providers, create a
production branch and sync code from main to production after each
release.
CI could copy main to production whenever a release is tagged.
Vortex deliberately leaves that step to a person, so nothing reaches
the production branch without someone deciding it should.
Before you begin
Make sure you have the following:
- The git-flow command-line extension, which provides the
git flowcommands - A clone of the project's repository set up with
git flow init. Usemainas the branch for production releases anddevelopas the development branch. Leave the version tag prefix empty, so tags readX.Y.Z. - Permission to push branches and tags to the project's repository
The git-flow cheat sheet shows how to install the extension and gives a quick reference on its commands.
Release operations
In each of the following commands, replace X.Y.Z with the release version
in your version scheme. To run a release:
-
Start the release:
git flow release start X.Y.ZThe command creates a
release/X.Y.Zbranch fromdevelop. -
Push the release branch to the remote, with
git push origin release/X.Y.Z. CI builds and deploysrelease/*branches, so the release gets its own build and deployment for final testing. -
Prepare the release:
- Commit the final bug fixes and documentation updates to the release branch.
- Review the draft release notes on GitHub (see Release notes publishing).
-
Finish the release:
git flow release finish X.Y.ZThe command makes these changes in your clone:
- Merges the release branch to
main - Tags the release
- Merges back to
develop - Deletes only the local release branch, so the remote copy stays
- Merges the release branch to
-
Push
main,developand the new tag, withgit push origin main develop X.Y.Z. CI builds the pushed branches and the tag, then deploys them under the Deployment rules. -
Deploy to production:
-
Tag-based hosting: deploy the tag to your production environment directly
-
Branch-based hosting (for example, Lagoon): manually sync
mainto theproductionbranch:git push origin main:productionThe first push creates the
productionbranch on the remote.
-
Expected release outcome
Confirm that the release meets these criteria, which your project's
docs/releasing.md also lists:
- The release branch exists as
release/X.Y.Zin the GitHub repository. - The release tag exists as
X.Y.Zin the GitHub repository. - The
HEADof themainbranch has theX.Y.Ztag. - The hash of the
HEADof themainbranch exists in thedevelopbranch, so everything pushed tomainalso exists indevelop. This check matters whenmainhad hotfixes not yet merged todevelop. - GitHub has no open pull requests related to the release.
- On branch-based hosting, the hash of the
HEADof theproductionbranch matches the hash of theHEADof themainbranch.