将文件推送到github并获取错误信息

将文件推送到github并获取错误信息,git,Git,我第一次尝试将文件从本地计算机上载到github 在尝试上传它们时,我发现了错误 error: src refspec master does not match any. error: failed to push some refs to 'https://github.com/name/file.git' 我已经环顾了stackoverflow,寻找类似的问题,并发现我认为这些问题已经回答了我的问题。我补充说 git remote rm origin git remote add ori

我第一次尝试将文件从本地计算机上载到github

在尝试上传它们时,我发现了错误

error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/name/file.git'
我已经环顾了stackoverflow,寻找类似的问题,并发现我认为这些问题已经回答了我的问题。我补充说

git remote rm origin
git remote add origin https://github.com:name/file.git
什么都没发生,我还需要补充什么

==编辑===

经过进一步研究,我发现

git commit-m“我的消息”就可以了

这返回了消息

5 files changed, 162 insertions(+)

进入我的存储库时,未添加任何内容

除非先提交任何内容,否则无法推送

你确实犯了。没有任何变化-它已提交,但文件保持不变。现在可以按了。

请参见“”:

第一次推送到GitHub需要是:

git push -u origin master

然后,在进行其他提交之后,您将能够简单地“
git push
”那些(不需要参数:本地主分支知道推送到哪里)

可能的重复:当您说什么都没有发生时,您尝试再次推送,对吗?你收到错误消息了吗?您是否输入了回购协议的实际名称,而不是“name/file.git”?另请参见