Skip to content

Rename default branch of existing project templates

Context

Since 14.0 the default name for the default branch is main instead of master: https://docs.gitlab.com/ee/user/project/repository/branches/default.html. Most of the current project templates have been created before 14.0 and use the previous default branch name.

Proposal

Let's inspect all project template repositories and set main as the default branch. The process of migrating should be relatively safe and simple because project templates are used to create new projects and the existing projects usually don't rely on the project template repo.

Steps:

  1. Identify whether a repo doesn't use main as the default branch
  2. Review whether the current default branch is additionally used (for example, by .gitlab-ci.yml or by Container Registry)
  3. Create main branch from the existing default branch
  4. Set main branch as the default one
  5. The previous default branch can be left in the repo. We can clean them up during a major release (even though it's unlikely necessary).

Project templates

Edited by Ash McKenzie