现象:在一个目录下初始化仓库之后,就开始push到github,结果出现了这个错误。

错因:初始化仓库之后,并没有使用git add,git commit 命令将文件添加到git仓库中,所以仓库为空,而空的仓库是不能提交到github的。

解决方案:

(1)使用命令 ,一次性添加所有文件到暂存区

git  add .

(2)使用命令,将暂存区的文件提交到本地仓库中。

git  commit  -m" 第一次提交"

(3)使用命令,将本地仓库中的文件提交到远程仓库中

 git push -u  ray_qiyeweixin  master

远程仓库ray_qiyeweixin的创建命令为:

git remote add ray_qiyeweixin git@github.com:shirayner/WeiXin_QiYe_Demo.git

Git_错误_02_error: src refspec master does not match any的更多相关文章

  1. git push 时发生错误 error: src refspec master does not match any. error: failed to push some refs to

    很多相关解决办法都是最后要 push 到远端的 master 上,但很多其实要求不能把个人的修改内容直接 push 到 master 主分支. 因此,当我想将本地 feature/work1 分支的修 ...

  2. GIT问题,error:src refspec master does not match any

    将本地GIT版本库PUSH到一个GITHUB上一个空的版本库时可能会出现如下错误error:src refspec master does not match any原因: 本地版本库为空, 空目录不 ...

  3. error: src refspec master does not match any. 错误处理办法

    自从上次学了git之后,很少用.今天在使用 本地仓库使用如下命令初始化: $ git init 之后使用如下命令添加远程库: $ git remote add origin git@github.co ...

  4. Git:错误:error:src refspec master does not match any

    新建立了一个远程仓库,想着把项目放上去.于是在项目目录上: git init 然后就添加远程库 git remote add origin xxxx.git 然后就想push: git push -u ...

  5. github上传时出现error: src refspec master does not match any解决办法

    github上传时出现error: src refspec master does not match any解决办法 这个问题,我之前也遇到过,这次又遇到了只是时间间隔比较长了,为了防止以后再遇到类 ...

  6. github上传时出现error: src refspec master does not match any解决办法22

    1 error:src refspec master does not match any这个问题,我之前也遇到过,这次又遇到了只是时间间隔比较长了,为了防止以后再遇到类似问题,还是把这个方法简单记录 ...

  7. git push 失败出现error: src refspec master does not match any.解决方案

    今天写好一个demo往GitHub上传时报错 错误提示: error: src refspec master does not match any. error: failed to push som ...

  8. error: src refspec master does not match any.

    执行下面的命令,git push 时候出错: git push origin master 出现如下错误: error: src refspec master does not match any. ...

  9. git 提交 src refspec master does not match any

    git init 产生的目录解释   error: src refspec master does not match any. 引起该错误的原因是,目录中没有文件,空目录是不能提交上去的 error ...

随机推荐

  1. args *args **kwargs区别

    python 函数中的参数类型有两种,分别为 位置参数和关键字参数: 一 .位置参数(该类参数位置固定不变) args:     表示默认位置参数,该参数是具象的,有多少个参数就传递多少参数,且参数位 ...

  2. X264使用指南

    x264是一个开源的H.264视频编码器库.是目前最好的有损视频编码器. 基本用法是 x264 [options]-o outfile infile 主页: http://www.videolan.o ...

  3. Android双缓冲技术

    参考文章: 1.http://djt.qq.com/article/view/987 2.http://blog.csdn.net/i_lovefish/article/details/7913623 ...

  4. centos set up samba

    原文中文链接:https://wiki.centos.org/zh/HowTos/SetUpSamba 原文英文链接:https://wiki.centos.org/HowTos/SetUpSamba ...

  5. 【很强大的Android图表引擎 - AChartSDK】

    在手机移动App开发中,图表在app中越来越占领举足轻重的地图.而在Android领域.AchartEngine 图表引擎可谓无人不知无人不晓. 可是今天就给各位推荐更为强大的图表引擎. 为什么说更为 ...

  6. 自定义circleindicator

    在此申明,并不是自己写的,只是为了方便日后使用 我使用的circleindicator是从大神的gitHub中弄来的, 使用如下: 一.在配置中导入 compile 'me.relex:circlei ...

  7. lua面向对象铺垫

    Account = { balance = , withdraw = function(self, v) self.balance = self.balance - v end } --:操作符隐藏了 ...

  8. Java获取字符串的CRC8校验码(由C程序的代码修改为了Java代码)

    CRC8算法请百度,我也不懂,这里只是把自己运行成功的结构贴出来了.方法CRC8_Tab这里没有处理,因为我的程序中没有用到. package com.crc; public class CCRC8_ ...

  9. POJ 1845-Sumdiv【经典数学题目---求因子和】

    转载请注明出处:http://blog.csdn.net/lyy289065406/article/details/6648539 優YoU  http://user.qzone.qq.com/289 ...

  10. php输出缓冲区

    ob_start(); echo 'aaa'; $string = ob_get_contents(); file_put_contents('a.html', $string); ob_flush( ...