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 'XXXX.git'

原因分析:

错误:SRC ReFSPEC主控器不匹配任何。
错误:未能将某些引用推到’git @ Github.com:HaHaa/ftpMal.git’

也就是仓库为空。


解决方案:

利用git add xxx.py 指令,将所有的文件全部都添加,然后再进行git commit -m "init"将所有的文件commit,

git commit -m "init"

   

然后在执行

git remote add origin xxxxxxxx.git

最后使用

$ git push -u origin master

参考文章

你可能感兴趣的:(开发问题记录专栏,开发工具,git,github)