Branches

The main branch (the default branch when you do a simple Git clone) is used for development, with other branches being used to maintain stable versions. Each stable branch is usually created just before the main branch is declared stable, because that is when some people start working on the next unstable development phase.

GNOME tries to use the same Git branch names for all core modules. The following rules are used for branch names:

  • Use only lowercase characters.

  • Use hyphens rather than underscores.

  • Use the format “gnome-VERSION” for the branch name if your branch is targeted for a new major release. Including the module name or the word “branch” is not necessary.

For example, gnome-45 would be an excellent choice for a branch name targeting the GNOME 45 release.

Example

Here’s an example, when branching for 45 (inside a clone of the module!):

git branch gnome-45 main
git push -u origin gnome-45

Where origin is the local name for the GNOME Git repository. The -u option (short for --set-upstream) ensures that the local branch is properly setup to track the remote branch.

The branch doesn’t have to be based on main if you already started development for the next version and the latest commits shouldn’t be included. You can put any git reference instead, such as a commit hash, or a tag.