Git__ERROR__src refspec master does not match any. 错误处理办法

要学习一个Spark源码,想在学习过程中加一些注释,便于日后自己回忆、与同事分享。所以下载了Spark源码,并上传到自己github。
在向远程push代码的时候,报上面错误。

原因:
本地仓库为空。即 git提交缓存中没有任何内容,也就是说,提交缓存是空的,没有标明需要提交哪些文件。

解决:

  rm -rf .git    ## 先把 spark 自带的 .git 目录删除
  git init       ## 初始化当前目录,为git目录.
  git remote add origin https://github.com/guyuetftb/gy_spark.git ## 添加远程仓库
  git add .      ## 将所有内容添加至 git 缓存
  git commit -m 'read spark source code'    ## 增加注释
  git push      ## 将代码推到远程.

你可能感兴趣的:(Git__ERROR__src refspec master does not match any. 错误处理办法)