我正在尝试这个:
mkdir ~/gitremote
cd ~/gitremote
git init --bare
我可以看到像这样的文件名:
HEAD config hooks objects
branches description info refs
好的,那么在另一个目录中,
git clone trosky@localhost:/Users/trosky/gitremote
vi readme (add one line)
git add .
git commit -m "1st file"
git push origin master
然后它会显示错误:
$git push origin master
error: src refspec master does not match any.
error: failed to push some refs to 'trosy@localhost:/Users/trosky/gitremote'
我在谷歌上搜索了一下,发现这种错误是由于远程仓库中的空文件夹引起的。但实际上,远程仓库并不为空,而且本地我提交的文件也不是空的。为什么还会出现这个错误呢?
如何解决?谢谢。