The name of the default branch is configurable with git-config, the default changed to "main" a while ago. You don't have to explicitly create that branch, the first commit goes there by default.
Like you've discovered, if there is nothing committed then you really don't have a branch yet (it would not make sense to have a branch with no content).
There are things that git configures per user and others that it configures per repo or both. That isn't completely obvious unless you know to look for it, though it does make sense once you know.
Since you are new to git, I'll just say that the free book is worth every second you spend with it. For my own use, the following tasks/topics have been very helpful:
- amending the last commit (message or otherwise)
- creating/using branches
- understanding "remotes" and how/when to push local branches
- the difference between "merge" and "rebase"
- git diff
- git status
- git is neither GitHub nor GitLab
- git restore <- this is your friend
I offer that list because it seems to cover the things that the people I help with git usually run into first. Otherwise, it depends on what you're doing, but if you conceive of a question that you want to ask about your code history, git can likely answer it.
--
Stephen L. Ulmer
Enterprise Architect
Mainline Information Systems
(m) 352-870-8649