git push 时 报error: src refspec main does not match any.

问题原因:
当前的本地git仓库为空仓库,需要将本地文件添加进本地git仓库,然后push。

解决方法:
在本地仓库执行:

git add .
git commit -m "git init"
git push -u origin master