Search code examples
gitgitea

Gitea - How to change the default branch name back to "master"


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

This is a problem for two reasons.

  • It is different to the default name which everyone has been used to using for many, many years
  • main is a common name for files inside a repository. For example main.cpp, main.py, etc.

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


Solution

  • 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