Add instance setting for default branch name for new repositories
Problem to solve
When creating a new repository with Git (including via GitLab), by default a branch is created that is named master. A branch is needed before commits can be added to it.
We should support the use of a different default branch by allowing instance administrators to choose their own default branch name to something like main because:
-
masteris not easily understood by people new to Git, and is not a ubiquitous term in technology (master is more easily associated with primary/secondary configurations) -
mastermay reference the master/slave terminology used by BitKeeper. Use of master/slave terminology has been removed in recent versions of many major software projects because it is not technically descriptive, precise, and avoids needlessly referencing the awful history and impact of human/slavery which continues to be felt by people all over the world.
This would also allow GitLab to select a new default in future for new self-hosted instances #221164.
Further details
Proposal
An Instance Administrator should be able to set the default branch name for the entire instance. All newly created projects should inherit this default.
For compatibility, the default value should be master. This can be changed in a future version of GitLab after proper communication.
Links / references
https://lore.kernel.org/git/[email protected]/T/#ma9a4da070ddf8ff87729960bb31ce2a8776c73c1
