error: src refspec main does not match any
尝试把远程仓库与本地仓库建立联系时遇到的问题:
我复制github的推荐的指令,尝试推送文件到github。
git init
git remote add origin git@github.com:wanqing99/wanqing99.github.io.git
git branch -M main
git push -u origin main
有报错error: src refspec main does not match any
应该是我新建的github仓库一个文件都没有导致的,所以先commit一下再push。
git add .
git commit -m 'chore: git init + hexo init'
git push -u origin main
浙公网安备 33010602011771号