Skip to main content

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:

  • Main branch is the single source of truth. All development merges back into it.
  • Feature and bugfix branches (feat/.* and fix/.*) are temporary. They exist only for isolated development and are deleted after merging.
  • Tagging is done on the main branch 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.0
  • release/v1.1
  • release/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.