Skip to content

Set the git default branch to "main"

What does this MR do?

In concert with the wider Git community, GitLab committed to changing the default branch from "master" to "main" in 14.0. This change has already happened on GitLab.com; this change enables it for self-managed instances as well.

GitLab has support for a custom default branch name which can be used to override this change if defaulting to "main" is inconvenient.

Unless overridden, this affects all new projects on all self-managed GitLab instances. Existing projects will not have their default branch changed.

The test suite still runs with the default branch set to master. Follow-up work will be required to change that before this feature flag can be completely removed, but it's important that we ship with it enabled in %14.0, so we shouldn't block this change on that.

Screenshots (strongly suggested)

Various functionality with this FF enabled:

Placeholder text for default initial branch (when unset) changes

Screenshot_from_2021-05-25_13-42-46

Creating a new project has the initial commit go to the main branch

Screenshot_from_2021-05-25_13-44-21

Screenshot_from_2021-05-25_13-44-41

Snippets use the main branch

Screenshot_from_2021-05-25_13-46-44

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related to #223789

Edited by Nick Thomas

Merge request reports