The remote HEAD is not the default branch

I maintain a git mirror of 1200 FOSS repositories. One that gets pushed and pulled across network boundaries.

Each git repository has a HEAD. The HEAD is best understood as a working pointer to the currently checked out branch, tag or commit. The HEAD is not a named ref like a branch or a tag. Because of this, it cannot be pushed to. When a repository is cloned, the value of the HEAD is also cloned. Each init or clone thus also creates a new HEAD.

Configured by the init.defaultbranch directive, the default branch specifies in which branch the first commit ends up. This setting can not be pushed to remotely.

Because the HEAD is the working pointer for each instance of a repository, the information of the purported "default branch" gets lost when working with your checkout. Other people cloning your instance will clone your working state. If you push your repository to an bare SSH mirror, that information is also lost: You'd have to go to your mirror via SSH and hand-edit the HEAD file to point to the right branch, so subsequent clones from there behave correctly. Git resists changing the HEAD in a bare repo, because a bare repo has no corresponding checkout. This is also why changing the HEAD on GitHub and Gitlab is an operation in the Web UI - Git just doesn't support it.

Now imagine all the trouble that is caused because some people changed master to main for performative reasons.