Skip to content

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:

.. 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

Edited by anarcat
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information