Couldn\'t find anything in the github documentation and also here on SO. But I was wondering if there could be a http://foo.github.com
for a private repository
According to GitHub Pages documentation:
All project repositories are ready to use the generator for publishing. However, please note that private repositories will publish pages that are public.
So no, at this time there is no way to create private GitHub pages from a private GitHub repository.
EDIT:
A workaround for some situations that might be helpful is to simply rename the repo to something other than the GitHub pages format while you want it to be private (for example in a development phase) and when ready to make it public then correct the name. Obviously this still doesn't help if you are looking for a way to publish pages that have authentication, but if you just want to hide a GH pages project while it's in progress, this could help.
Alternatively, there is a project called Jekyll Auth that GitHubber @benbalter made for such use. Jekyll Auth provides a basic authentication wrapper for jekyll projects, including GitHub pages. See the repo's README for use.
So sad It's 2020 and we are not able to have private GithubPäges:
As outlined above, Github pages do not support that functionality. I had the same issue when our team decided to host project documentation (static HTML) internally and privately.
I ended up creating a service https://www.privatehub.cloud It is basically a simple proxy server with Github OAuth authentication, so it merely returns your GitHub repository content with a proper MIME type. By design, only who have access to foo
will be able to see foo
content at https://bar-foo.privatehub.cloud
. From functional point of view, you can think about it as a simplified GitHub pages with built-in authentication.
Unfortunately, Github OAuth does not allow to request read-only
access to private repos, so the server needs the full access (obviously, it does not write anything to your repo). As GitHub API allows to retrieve files under 1 Mb only, the service cannot return larger files. Yet, I found the service is quite suitable for small projects for internal documentation or staging version of a website.
Many answers are outdated (pre-Microsoft acquisition/free private repos). This one was written after the announcement of free private repos.
Github pages are not available on free private repos for individuals, as shown in the repo settings:
2020 (most basic plan is now "Team"):
All pages are public, even if you upgrade. Upgrading only enables the Pages feature on private repos, just like it enables other features. The Pages feature is publicly available static web hosting.