failed to push some refs to xxxx

***************ssh  秘钥上传远程仓库

1. 添加远程仓库ssh 命令   git remote add origin  git@github.com:ThreeNut/zou.git    ThreeNut你自己的gitHub账号名 /zou 远程仓库名字

2.执行把本地推送到远程仓库 git push -u origin master 时出错了

error: src refspec master does not match any.

error: failed to push some refs to xxx

此时需要到本地有.git的目录下提交一下本地仓库 可以新建任意文件这样提交远程仓库可以看出效果

(本人使用的TotoiseGit提交的 )  也可以命令提交 git add .

提交描述  git commit -m "first commit"      

之后再执行  git push -u origin master             ............ok!

************也可以使用https 方式 需要输入账号 和 密码

原文地址:https://www.cnblogs.com/july7/p/12718710.html