使用git push是,采用以下步骤:
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/focusor/focusor.github.io.git
git push -u origin master
产生如下错误:
error: src refspec master does not match any.
error: failed to push some refs to "xxxxxxx"
然后用如下方法解决了:
git add .
git commit -m "write your meaaage"
之后push就成功了,具体原因是什么呢?
这种错误一般是因为push的时候暂存区没有文件,确认下add的README.md存不存在