在github文档和这里也找不到任何东西。但是我想知道是否有一个名为foo的私人存储库http://foo.github.com,只有一个人可以访问foo存储库本身。

我记得读过一些关于github页面总是公开的东西,但似乎再也找不到了。

令人惊讶的是,我似乎也找不到其他人问这个问题。


当前回答

你可以把密码存储在一个存储库中,然后把页面隐藏在隐藏地址后面,隐藏地址是由密码派生的。这不是一种很安全的方法,但很简单。

示范

其他回答

2021年1月:GitHub企业版现在可以实现(所以:github.com还没有)。 看到的:

GitHub页面的访问控制

GitHub Pages now gives you the option to limit access, making the site visible only to users with access to the repository that published the Page. With access control, you can use GitHub Pages to publish and share internal documentation and knowledge across your enterprise. As part of this release, we are introducing the following capabilities: Repo admins can select whether GitHub Pages sites are publicly visible or limited to users who have access to the repository. Both private and internal repositories support private visibility. With an internal repository, everyone in your enterprise will be able to view the Page with the same credentials they use to login to github.com Org admins can configure the visibility options that members will be able to select for their Page. For example, you can enforce that your members can only publish content privately. This feature is generally available today on GitHub Enterprise Cloud. To enable access control on Pages, navigate to your repository settings, and click the dropdown menu to toggle between public and private visibility for your site.

如果您在私有回购上按下admin键,并向下滚动到关于页面的部分,它会写它将是公共的。我稍后会检查是否.htaccess control或类似的是可能的,但我不太希望它。

github.com页面确实提到:

Github页面免费托管,通过我们的网站轻松发布,

没有提到访问控制。

GitHub页面帮助也没有提到任何ACL。 它们最好在gh-pages分支中进行管理,也可以在它们自己的子模块中进行管理。 但同样,在GitHub发布后,没有任何可视性限制。

我已经对Github提出了支持票,并得到了一个回应,确认所有页面都是公开的。我现在要求他们在help.github.com/pages上添加备注。

根据GitHub Pages文档:

所有项目存储库都已准备好使用生成器进行发布。但是,请注意,私有存储库将发布公开的页面。

所以,目前还没有办法从私有的GitHub存储库创建私有的GitHub页面。

编辑:

一个简单的解决方法

对于一些可能有帮助的情况,一个解决方案是简单地将repo重命名为GitHub页面格式以外的东西,而你想要它是私有的(例如在开发阶段),当准备好将其公开时,然后更正名称。显然,如果您正在寻找一种方法来发布具有身份验证的页面,这仍然没有帮助,但如果您只是想在GH页面项目进行时隐藏它,这可能会有所帮助。

一个真实的Jekyll认证包装器(GitHub页面)

或者,有一个名为Jekyll Auth的项目,GitHubber @benbalter为此而制作。Jekyll Auth为Jekyll项目(包括GitHub页面)提供了一个基本的身份验证包装器。请参阅回购的README以获得使用。