美文网首页
Git 提示error:src refspec master d

Git 提示error:src refspec master d

作者: 4b6faa1b17a3 | 来源:发表于2017-07-06 20:26 被阅读0次

    git push origin master提示

    error:src refspec master does not match any
    

    这个问题之前遇到过,这次又遇到了只是时间间隔比较长了,为了防止以后再遇到类似问题,还是把这个方法简单记录在此。

    问题产生原因分析

    引起该错误的原因是,目录中没有文件,空目录是不能提交上去的,而且在push之前至少有过一次commit
    解决方法

    git init 
    git touch READMEgit 
    git add README 
    git commit -m 'first commit'
    git remote add origin https://github.com/Cycamore/lantingtalk.github.io.git
    git push origin master
    

    相关文章

      网友评论

          本文标题:Git 提示error:src refspec master d

          本文链接:https://www.haomeiwen.com/subject/rhdkhxtx.html