Home > Back-end >  Gitea - How to change the default branch name back to "master"
Gitea - How to change the default branch name back to "master"

Time:09-27

I've installed Gitea, and every time I create a new repository it defaults the master branch name to "main", which I find a bit annoying.

Is there a way to make it default back to the normal "master" naming convention? If so how do I do this?

CodePudding user response:

When is your version of gitea changing 'master' to 'main' it should also support configuration value DEFAULT_BRANCH under the Repository section of init file. More details could be found in official documentation

CodePudding user response:

At the group level, you can set a "custom initial branch name"

Users with at least the Owner role of groups and subgroups can configure the default branch name for a group:

  • Go to the group Settings > Repository.
  • Expand Default branch.
  • Change the default initial branch to a custom name of your choice.
  • Select Save changes.

Projects created in this group after you change the setting use the custom branch name, unless a subgroup configuration overrides it.

It is true that, since GitLab 14.0, the default name has changed from master to main.
Same for GitHub. Or BitBucket.

  • Related