> L B:
>
>> I’m curios if there is a best practice to rename the master branch in
>> gitolite repos to main.
>
> Just do it.
> [...]
> Did I miss something?
>
You can do this to make it global:
1. ssh root@yourserver
2. sudo -u gitolite /bin/sh
3. git config --global init.defaultBranch main
Then whenever you add a repo to gitolite-admin it will be created with 'main'.
However, if you're also using *wildrepos* you will probably run into the same glitch I did: users can use init.DefaultBranch locally too, and there's no reason they will all choose 'main'. When a new repo is pushed, the wildrepo code runs `git init --bare`, which sets the branch based on the gitolite@yourserver's init.defaultBranch.
Sitram helped me out with this, spending time figuring out a workaround: https://groups.google.com/g/gitolite/c/NwZ1-hq9-9E
-Nick
> Dirk Heinrichs <dirk.he...@altum.de> wrote:
>
>> Did I miss something?
>
> When I looked into this several months ago, the difficult part was to
> update the symbolic ref for HEAD on the server: there was no way to do
> that over the git protocol, so it required special access on the server.
> This is why the various git hosting services have special webby UI for
> renaming the default branch, but no howto for doing it via the command
> line.
gitolite provides this access! https://groups.google.com/g/gitolite/c/NwZ1-hq9-9E:
```
ssh gitolite@yourserver symbolic-ref my/repo HEAD refs/heads/trunk
```