Branching Models
Single Mainline Branching Model
The
Single Mainline Branching Model
is a simple branching model where all changes ultimately merge into a single
main branch. Feature development and bug fixes happen on short-lived
branches, e.g. feat/.* and fix/.*, that get merged back into main after
completion.
The diagram illustrates this model in the following steps:
Long-Lived Branches:
- The
mainbranch is the single source of truth. All development merges back into it.
Feature Branches:
- For features and bug-fixes,
feat/.*andfix/.*are temporary feature branches. They exist only for isolated development and are deleted after merging (normally tomain). There is only one person working on it.
Tags:
- Tagging is done on the
mainbranch with Git version tags.
This model ensures a simple stable, incremental, and organized approach to software development. 🚀
Maintaining Releases
If you really need to maintain releases over time (which you should avoid in
general), you can always introduce release/v<partial-sem-version> branches
(branched off from main and potentially long-living branches), e.g.
release/v1.0release/v1.1release/v2.0
where you will maintain the versions for major/minor version 1.0, 1.1 and
2.0, for example.
Git Version Tags
Git version tags are of the form v<sem-version>, i.e. they always start with
v and a following semantic version number.