Made available under the Creative Commons Attribution-ShareAlike license.
master
branch is a new release by definition but publishing patches to
past releases leads to release commits which are not on the master
branch.master
collects changes towards the next major release.release/X.Y
branches collect changes towards the next minor release.release/X.Y.Z
branches collect changes towards the next patch release.master
or towards release/X.Y
branches.release/X.Y.Z
never receive new features, they only receive bugfixes.The release process consists of the following steps: feature freeze, converging a release candidate, and tagging a release.
Feature freeze is the moment when a new release branch is created, either
release/X.Y
is created from master, or release/X.Y.Z
is created from
release/X.Y
. The creation of a release branch may be delayed up to the
moment until the root branch receives changesets towards the next major or
minor release.
Often some work needs to be done between a feature freeze and arriving at the release commit: this work typically consists of bugfixes, cosmetics, documentation, together with testing.
Tagging a specific commit with a release version creates the actual release. We recommend to use annotated tags because they contain the author of the tag.
release/X.Y.Z
, or release/X.Y
, or
master
, depending on the intent.release/X.Y.Z
require to bump the patch number,
signalled by creating a new tag.release/X.Y.Z
can, if necessary, be ported
to release/X.Y
and further to master
by merging.master
can, if necessary, be ported to release/X.Y
and
release/X.Y.Z
by cherry picking.When creating a new branch for a PR, it should always start off from the branch to which the change is directed. The naming of the new branch should follow standard feature/issue branch naming conventions, i.e. the feature branch in the fork should not be named identical to the target branch in the upstream repository (see Do Not Issue Pull Requests From Your Master Branch).
Explanation:
Example:
release/1.0.Z
fixing issue 137, fork the repository,
and in the fork create a branch release/1.0.Z-issue-137
from
release/1.0.Z
and submit PR towards the upstream release/1.0.Z
. Branch
release/1.0.Z-issue-137
can be deleted after the PR is accepted.release/X.Y.Z
upstream branch.master
(then they are scheduled for the next major release)
or to the corresponding release branch (then they are scheduled for the next minor release) and then ported to master
.master
upstream branch.If you never want to release patches to released versions, tagging versions on
master
is probably sufficient. The moment your project receives patches to
released versions, you need to create branches.
This model probably still makes sense but you probably do not need two levels of release branches but probably require only one, supporting each release.
You can employ this model also within a single repository. For this
write-protect master
and release branches and employ code review before
accepting merges from feature or bugfix branches towards either master
or
release branches.
Possibly - but branches are cheap. If you do not like to have a branch for each single release, you can delay the creation of a corresponding release branch until the moment when a past release is about to receive a patch which you would like to isolate from other changes which have the past release as parent.