error: refname refs/heads/master not found
error: refname refs/heads/HEAD not found
fatal: Branch rename failed
$ git checkout -b main
error: refname refs/heads/master not found
error: refname refs/heads/HEAD not found
fatal: Branch rename failed
$ git checkout -b main
error: refname refs/heads/master not found
I get into this issue too. The reason is that I didn't have any commit on this
git repository.
When I run the command git branch -M main. I get the following error message.
error: refname refs/heads/master not found
fatal: Branch rename failed
After I add my first commit by the following command, all things works.
git add .
git commit -m 'Init'
GIT Error refname refs/heads/master not found
git fetch
git reset --hard origin/master
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us