mainalways mirrors the latest code that has actually shipped. Every public release commit lives onmainand is tagged there.- For each major series we keep a long-lived
N.xbranch (for example0.x,1.x,2.x, …). That branch collects all work that will eventually be released asN.y.z. - A series branch covers the entirety of that major train:
0.xcarries everything from0.1through0.1.0,0.2.3, etc.; when we move on to1.0we repeat the pattern with1.x, and so on. - There is no separate release branch. The matching
N.xbranch is the staging ground; once it is ready we merge it tomainand cut the tag.
- Identify the active series branch (e.g.,
0.x). That branch always tracks the next unreleased work. - Create short-lived feature branches from that series branch:
git switch -c feature/xyz 0.x. - Land pull requests back into the same series branch (
0.x). Keep it green: rebase frequently, run the full test suite, and update documentation there. mainstays untouched during the iteration and continues to point at the previously shipped tag.
- Pick the exact semantic version you plan to ship (e.g.,
0.3.0). - Ensure the matching series branch (e.g.,
0.x) already contains every change you want plus any release-specific metadata (CHANGELOG entries, config tweaks, etc.). - Merge the series branch into
main(fast-forward if possible):git switch main && git merge --ff-only 0.x. - Tag the resulting commit on
mainusing thev<major>.<minor>.<patch>format:git tag v0.3.0 && git push origin main v0.3.0. - Deploy from
mainso production always matches the latest tag.
- After tagging (say
v0.3.0), decide whether you need to keep the old series alive for hotfixes. If so, leave the0.xbranch in place for those fixes; otherwise it can be closed. - Start the next cycle by creating the new series branch from
main:git switch -c 1.x main. From that point onward, all feature work for1.0through1.0.0lands on1.xuntil it is merged back intomainand tagged. - At any given time
mainmust track whichever series branch represents the most recent release so that the code onmainand the highest tag are always in sync.
- Feature work →
feature/*branches cut from the activeN.xseries branch. - Integration/testing → happens directly on the series branch (
N.x). - Release → merge
N.xtomain, then tagvN.y.zonmain. - Latest code in production → always the HEAD of
mainand the highestvN.y.ztag.