Quantcast
Channel: git: rename local branch failed - Stack Overflow
Viewing all articles
Browse latest Browse all 11

Answer by Lichi for git: rename local branch failed

$
0
0

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 foundfatal: Branch rename failed

After I add my first commit by the following command, all things work.

git add .git commit -m 'Init'

Viewing all articles
Browse latest Browse all 11

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>