change the default Git branch to "main" in GitLab
We currently do not have any special configuration in GitLab regarding the branch name, which, in Git, defaults to master
. Following recent events there has been a far and wide ranging conversation about changing that default to something else. Everywhere people are trying to get rid of that wording:
- GitHub is changing to
main
on October 1st 2020. - Puppet has been progressively removing mention of "master" and "blacklist"
- Git has introduced a setting to make the default changeable
- there's a proposal to do the change in Wordpress as well
.. and that list is not exhaustive.
We should follow suit. There's already a proposal to make the change in tor/core but we should also change the default in GitLab as a whole. That's done in this admin section:
https://gitlab.torproject.org/admin/application_settings/repository
That affects only new repositories, for existing repositories, there are various recipes to make the change, but it's less trivial. Also note that this does not affect wiki branch names.
For now I propose we only change the default. GitHub has been working on procedures to rename branches which could prove interesting.
Update: @anarcat wrote this program to rename branches locally and on GitHub in batch: https://gitlab.com/anarcat/scripts/-/blob/main/git-branch-rename-remote