git和github使用中遇到的问题

1、

错误信息:

error: src refspec main does not match any
error: failed to push some refs to 'https://github.com/AntsGnawingBone/bigevent.git'

情况描述:本地初始化了,也commit了,但是在commit的时候没有写: -m '提交描述'。

解决方法:重新commit 并加上了 -m '提交描述',然后就正确提交了。

解决过程:看到这个提示,就去百度,找到这样一篇:https://www.jianshu.com/p/8d26730386f3,他说:引起该错误的原因是,目录中没有文件,空目录是不能提交上去的;可见如果是空目录,只有git init以后的git隐藏文件夹也会报错。