在git中推送提交时,src refspec master不匹配任何内容 [英] src refspec master does not match any when pushing commits in git

查看:107
本文介绍了在git中推送提交时,src refspec master不匹配任何内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我克隆了我的仓库:

I cloned my repository with:

git clone ssh://xxxxx/xx.git 

但是在我更改了一些文件并且添加了 commit 他们我想推送他们到服务器:

but after I changed some files and add and commit them I want to push them to server:

git add xxx.php
git commit -m "TEST"
git push origin master

但是我得到的错误返回是:
$ b

But the error I get back is:

error: src refspec master does not match any.  
error: failed to push some refs to 'ssh://xxxxx.com/project.git'


推荐答案

也许你只需要提交。当我这样做时,我遇到了这个问题:

Maybe you just need to commit. I ran into this when I did:

mkdir repo && cd repo
git remote add origin /path/to/origin.git
git add .

糟糕!从未提交过!

git push -u origin master
error: src refspec master does not match any.

我所要做的只是:

All I had to do was:

git commit -m "initial commit"
git push origin master

成功!

这篇关于在git中推送提交时,src refspec master不匹配任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆