我尝试按照这篇帖子中提出的解决方法,但它没有起作用,我仍然收到错误信息:src refspec master does not match any。
这是我所做的: 按照这个解决方案。
// adding the file I created
$ git add .
$ git commit -m 'initial commit'
$ git push origin master
error: src refspec master does not match any.
当做:
$ git push origin HEAD:master
b40ffdf..a0d1423 HEAD -> master // looks promising
// adding a remote
$ git remote add devstage -f <another git>
$ git merge devstage/master -s recursive -X ours
$ git push -u devstage master
error: src refspec master does not match any.
更多信息:
$ git branch
* origin
$ git show-ref
refs/heads/origin
refs/remotes/devstage/master
refs/remotes/origin/HEAD
refs/remotes/origin/devstage
refs/remotes/origin/master
refs/remotes/origin/origin
所以我肯定缺少refs/heads/master,但不知道如何创建它。
谢谢
git push origin master
更改为git push origin main
。 - Vintage Coder