当初始化一个github项目的时候

按照github提示执行到

git branch -M main

 

返回错误:

error: refname refs/heads/master not found

 

解决:

git add .

git commit -m "init"

 

然后在执行

git branch -M main

相关文章: