user2138149
user2138149

Reputation: 16715

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.

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

Upvotes: 24

Views: 6967

Answers (2)

jojobyte
jojobyte

Reputation: 81

If modifying the ini config (conf/app.ini) file:

# ...
[repository]
DEFAULT_BRANCH = master
# ...

If you happen to be running in a Docker Compose (docker-compose.yml) setup:

version: '3'
services:
  gitea:
    image: gitea/gitea:latest
    # ...
    environment:
      - GITEA__repository__DEFAULT_BRANCH=master
      # ...
  • Note these are missing all the other settings that are probably needed, just showing where to put the ENV Variable.

Upvotes: 8

raliscenda
raliscenda

Reputation: 466

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

Upvotes: 16

Related Questions