renaming the default branch of a repo in Gitea

created onAugust 29, 2025

I was already tired for a while that the default repo name in git was master. So I took the opportunity when updating Gitea to rename the default branch of the corresponding git repos to main.

Rename master to main in my ’local’ repo with and push it to Gitea with

Now Gitea has two branches main and master for that repo. In order to be able to delete branch master, branch main has to be set as the default branch of that repo.

In Gitea, open the repo view and click Settings.

Gitea repository view

Gitea repository view
click on image to enlarge

x

In the settings view, click on Branches. In the Default Branch panel, select branch main and click Update Default Branch.

Gitea repository basic settings view

Gitea repository basic settings view
click on image to enlarge

x

Delete branch master in Gitea with .

x