首页 > 解决方案 > 错误:src refspec "depositoryname" 不匹配。错误:未能将一些参考推送到“https://g”

问题描述

我只是想将我的 git 存储库上传到 GitHub,它向我显示了这条消息。

error: src refspec depositoryname does not match any.  
error: failed to push some refs to 'https://github.com/<me>/project.git'

我实际上是在做一步一步的教程,一切都应该是正确的,但事实并非如此。
有人可以帮忙吗?

标签: gitgithub

解决方案


如此处所示,错误可能来自git add .在 a 之前使用,git commit这会导致分支为空。

尝试并推送(默认为“主”)分支将导致该错误消息。
5假设这里' depositoryname'是一个分支的名称)


推荐阅读