Branches¶
TL;DR
mainholds released code,developis the integration branch, and every issue gets its own branch fromdevelop.- Issue branches are squashed into
develop: one commit per issue. developgoes intomainby merge commit or rebase, keeping the squashed history.- Repository rulesets enforce the merge methods on every PR into a branch.
| Branch | Purpose | Protection |
|---|---|---|
main |
released code; every commit is releasable | no deletion, no force-push changes only through a PR, merged with merge commit or rebase |
develop |
integration branch; feature branches merge here | no deletion, no force-push changes only through a PR, merged with squash |
feature/<issue>-<slug>bugfix/<issue>-<slug>docs/<issue>-<slug>chore/<issue>-<slug> |
one issue each, from develop |
none |
The flow¶
feature/12-version-filter→ PR intodevelop(squash: one commit per issue).- PR
develop→main(merge commit or rebase, keeping the squashed history). - Tag on
main.
gitGraph
commit id: "v0.1.1" tag: "v0.1.1"
branch develop
checkout develop
branch "feature/12-version-filter"
commit id: "work"
commit id: "tests"
checkout develop
merge "feature/12-version-filter" id: "squash: one commit per issue"
branch "docs/123-mvp1-docs"
commit id: "docs"
checkout develop
merge "docs/123-mvp1-docs" id: "squash"
commit id: "v0.2.0.dev1" tag: "v0.2.0.dev1"
checkout main
merge develop id: "release PR (merge or rebase)" tag: "v0.2.0"
The branch names in the graph are examples.
feature/*,bugfix/*,docs/*andchore/*branches are squashed intodevelop.developis merged (or rebased) intomain.- A tag on
developpublishes a dev pre-release, a tag onmaina stable release (Versions and tags). - The registry then keeps only the newest images (Image retention).
Merge methods¶
The merge methods are enforced by repository rulesets on the target branch, so they apply to every
PR into it, whatever the source branch. A rare main → develop back-merge is squashed too.