今天本来想把内容上传到git仓库去,但是折腾了好久一直报错(该问题只是本人遇到的,解决不了大家的问题,别喷,谢谢)。
error: src refspec master does not match any
error: failed to push some refs to
最后原来是github更新了,现在github的默认分支为main,但是,我一直认为是master,所以,在提交时,需要提交到main,而不是master。
使用:git push origin main
,即可。文章来源:https://uudwc.com/A/orbZz
汇总一下今天一天查到其他人遇到该问题原因:文章来源地址https://uudwc.com/A/orbZz
- 本地git仓库目录下为空
- 本地仓库add后未commit
- git init错误
- 没有先进行git pull