内容简介:翻译自:https://stackoverflow.com/questions/2015530/git-clone-does-not-bring-master-branch
这个repo有一个master分支,但它在其他两个分支后面,所以当我克隆它时,我得到了这个警告:
warning: remote HEAD refers to nonexistent ref, unable to checkout.
而且我也没有得到本地主分支(git分支没有显示任何内容).
我可以解决整个问题:
git checkout -b master origin / master
但我想知道为什么会这样?主人应该是更先进的分支吗?或者我的回购还有其他问题吗?
1 /不,掌握不是最先进的分支.一个人只能发布到另一个分支,然后删除该分支……
2 /当发生这种情况时,您应该从github repo的管理面板中选择master作为默认分支,但这并不总是可行的.见 this bug
For anyone else who has hit this issue:
tekkub told me how to get around this bug via the freenode #github channel.
- create a temporary branch,
- push that to your repo,
- select the default branch in the admin panel for that repo,
- then delete the branch and push again.
Worked for us.
(想法是暂时有两个分支,以便能够通过GUI管理面板选择master作为默认值,然后删除额外的分支)
翻译自:https://stackoverflow.com/questions/2015530/git-clone-does-not-bring-master-branch
以上所述就是小编给大家介绍的《Git clone不带master分支》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Scalability Rules
Martin L. Abbott、Michael T. Fisher / Addison-Wesley Professional / 2011-5-15 / USD 29.99
"Once again, Abbott and Fisher provide a book that I'll be giving to our engineers. It's an essential read for anyone dealing with scaling an online business." --Chris Lalonde, VP, Technical Operatio......一起来看看 《Scalability Rules》 这本书的介绍吧!