天天看点

error: src refspec master does not match any

问题记录:

在使用git bash指令将项目上传到github时,遇到的问题。

错误:

error: src refspec master does not match any.

error: failed to push some refs to 'xxx'

分析:

        应该未能将某些引用推到'git @ Github.com:xxx.git’

        可能就是仓库为空。

解决办法三步曲:

1、将所有的文件全部都添加,然后再进行git commit -m "init"将所有的文件commit,

git commit -m "init"

2、然后在执行

$ git remote add origin xxxxxxxx.git

3、最后使用

$ git push -u origin master

1、上传文件到git最简单的方式