首页 > 其他 > 详细

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

时间:2018-08-02 00:45:09      阅读:165      评论:0      收藏:0      [点我收藏+]

今天写好一个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要留意是否需要配置用户名和邮箱名

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

原文:https://www.cnblogs.com/curo0119/p/9404770.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!