zoukankan      html  css  js  c++  java
  • 转 git push 失败出现error: src refspec master does not match any.解决方案

    今天写好一个demo往GitHub上传时报错

    错误提示:

    error: src refspec master does not match any.

    error: failed to push some refs to 

    找了下原因,原来是git commit -m "xxx" 时没留意,因为新装的git需要提交用户邮箱和用户名,

    所以没有委托成功,本地仓库是空的,所以配置了下邮箱和用户名才成功,真是粗心不得啊!!!

    *** Please tell me who you are.

    Run

     git config --global user.email "you@example.com"

     git config --global user.name "Your Name"

    to set your account's default identity.
    Omit --global to set the identity only in this repository.


    分析:

    1.本地git仓库目录下为空

    2.本地仓库add后未commit

    3.git init错误

    解决方法:

    1.控制面板打开文件夹选项  打开隐藏文件和文件夹显示

    2.到本地仓库目录下查看是否有.git文件夹——无 则git init

    3.看.git文件夹下是否有之前提交的文件——若无 则重新 git commit (如果之前git add过的话 没有就要重新 add commit)

    4.新装的git要留意是否需要配置用户名和邮箱名

  • 相关阅读:
    web标准化布局
    最全前端资源汇集
    SVN使用教程
    FullPage.js中文帮助文档API
    如何选字体(font-family)
    网站禁止复制类型的属性
    Web前端学习方向
    div 命名规范! (野路子出来的好好看看)
    浏览器兼容处理
    JSONP 跨域问题
  • 原文地址:https://www.cnblogs.com/python-xiakaibi/p/12982465.html
Copyright © 2011-2022 走看看