其他分享
首页 > 其他分享> > git branch error: refname refs/heads/master not found

git branch error: refname refs/heads/master not found

作者:互联网

项目场景:

进行初始化git的时候


问题描述:

进行初始化git的时候:

git init 
git add .
git branch -M master
git remote add origin git@github.com:xxx/xxxx.git
git push origin master

到了git branch -M master这一步,报错:

> git branch -M master
error: refname refs/heads/master not found
fatal: Branch rename failed

原因分析:

找了一大圈原因,结果大跌眼镜
原因是:没有commit 成功!


解决方案:

重新commit

标签:origin,git,heads,refs,master,branch
来源: https://blog.csdn.net/qq_36282029/article/details/116884997