gitee创建新的项目和仓库后首次提交代码提示src refspec master does not match any.
原因是没有调用git commit 命令
我最开始的调用顺序是
git init
git commit -m ‘init’
git remote add origin ‘此处是远程仓库地址’
git add .
git push -u origin master
结果就提示src refspec master does not match any.
应该是commit的调用的顺序错误,应该是在git add. 之后调用,所以在commit一次,然后push就成功了,如下
git commit -m 'init'
git push -u origin master