错误:src refspec master与任何不匹配 [英] error: src refspec master does not match any

查看:685
本文介绍了错误:src refspec master与任何不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图按照这篇文章,但它没有工作,我仍然得到:src refspec主不符合任何。



以下是我所做的:
后续 解决方案

  //添加我创建的文件
$ git add。
$ git commit -m'initial commit'
$ git push origin master
错误:src refspec master不匹配任何。

执行操作时:

  $ git push origin HEAD:master 
b40ffdf..a0d1423 HEAD - > master //看起来很有前途

//添加一个远程
$ git remote add devstage -f<另一个git>
$ git merge devstage / master -s递归-X我们
$ git push -u devstage master
错误:src refspec master不匹配任何。

更多信息:

  $ git branch 
* origin
$ b $ 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,但不知道如何创建它。

谢谢 看起来您的本地分支名称是origin。



您可以用 -mv 标志,如下所示:

git branch -mv origin master



在这个 git分支之后应该显示 master : - )



为了确保名称确实是唯一误入歧途的东西,您可以运行 git log 并查看最后几个提交 - 并将它们与bitbucket网站上的最后几项提交进行比较。


I have tried to follow the solutions suggested in this post but it didnt work and I am still getting: src refspec master does not match any.

Here is what I did: Followed this solution

// adding the file I created
$ git add .
$ git commit -m 'initial commit'
$ git push origin master
error: src refspec master does not match any.

When doing:

$ 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.

More information:

$ 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

So I am definitely missing refs/heads/master but dont know how to create it.

Thanks

解决方案

From git branch it appears that somehow your local branch name is "origin".

You can rename the branch with -mv flag, like this:

git branch -mv origin master

After this git branch should show master :-)

Just to make sure the name is indeed the only thing that went astray, you can run git log and look at the last few commits - and compare them to the last few commits on bitbucket website.

这篇关于错误:src refspec master与任何不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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