今天在新建GitHub仓库上面上传命令时出现错误
error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/SFtheC/It-s-my-practice-.git'
后发现master的原因:
在使用
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/SFtheC/2048clone.git
git push -u origin main
系列命令后,新建仓库名为main,不在是master;
可以用:
git branch -m master main修改本地仓库名后再push就ok了!