我使用以下内容克隆存储库:

git clone ssh://xxxxx/xx.git 

但在我更改一些文件并添加和提交它们之后,我想将它们推送到服务器:

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

但我得到的错误是:

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

当前回答

也许GitHub不知道你是谁。

首先,您必须运行:

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

其他回答

首先,您需要gitinit来创建您自己的.git文件,否则如果您克隆了某个git文件夹,它将无法识别您的git凭据。启动git后,继续执行gitadd。和gitcommit。。。

首先,gitadd。第二,gitcommit-m“message”第三,git推送原点分支

请检查拼写错误,因为这也可能导致错误。

也许GitHub不知道你是谁。

首先,您必须运行:

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

我也犯了类似的错误。但Git告诉我:

*** Please tell me who you are.

Run

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

或设置帐户的默认身份。

Omit --global to set the identity only in this repository.

然后错误消失。

我也收到了这个问题,但这是因为我在推送之前意外关闭了服务器。这也会导致同样的错误。