I am trying to publish my third site, so I fairly new to github, and I am getting: the following error:
$ git branch -M main
error: refname refs/heads/master not found
fatal: Branch rename failed
I have used git-bash, them some code on github account, and on the above stage I got the error.
I am bit stuck, I have search for the error, but I could not fix it.
I may be wrong but I believe that since a branch is a pointer to a commit, if no commit has been created yet, then no branch exists. So you cannot rename a branch which does not exist. The solution would be to do a first commit, which will create a branch (master by default), and then you should be able to rename it (now that it exists).