In the Pro Git book, it says
“origin” is not special
Just like the branch name “master” does not have any special meaning in Git, neither does “or
You can, indirectly, configure git init to use a different default branch: the current branch is defined by HEAD, which is “just” a textfile telling Git which ref is the current one.
Using init.templateDir, you can ask git init to use a different one:
# ~/.config/git/config or ~/.gitconfig
[init]
templateDir = ~/.config/git/template/
and in ~/.config/git/template/HEAD, put a single line (+ linebreak): ref: refs/heads/main (to default to branch main).
The whole contents of templateDir are copied to the .git directory when creating a repository; the default (here /usr/share/git-core/templates) contains some sample hooks and other files, but you can use your new template directory to setup default hooks, for example.
$ tree /usr/share/git-core/templates
/usr/share/git-core/templates
├── branches
├── description
├── hooks
│ ├── applypatch-msg.sample
│ ├── commit-msg.sample
│ ├── fsmonitor-watchman.sample
│ ├── post-update.sample
│ ├── pre-applypatch.sample
│ ├── pre-commit.sample
│ ├── prepare-commit-msg.sample
│ ├── pre-push.sample
│ ├── pre-rebase.sample
│ ├── pre-receive.sample
│ └── update.sample
└── info
└── exclude
3 directories, 13 files