Git clone不带master分支

栏目: 编程工具 · 发布时间: 6年前

内容简介:翻译自:https://stackoverflow.com/questions/2015530/git-clone-does-not-bring-master-branch
我有一个远程存储库 http://github.com/fernandezpablo85/Test

这个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分支》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Ajax for Web Application Developers

Ajax for Web Application Developers

Kris Hadlock / Sams / 2006-10-30 / GBP 32.99

Book Description Reusable components and patterns for Ajax-driven applications Ajax is one of the latest and greatest ways to improve users’ online experience and create new and innovative web f......一起来看看 《Ajax for Web Application Developers》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

在线进制转换器
在线进制转换器

各进制数互转换器

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具