If you're familiar with command-line Git, it's straightforward to manually create a Project Pages site.
Make a fresh clone
To set up a Project Pages site, you need to create a new "orphan" branch (a branch that has no common history with an existing branch) in your repository. The safest way to do this is to start with a fresh clone:
git clone hostname/user/repository.git # Clone our repository Cloning into 'repository'... remote: Counting objects: 2791, done. remote: Compressing objects: 100% (1225/1225), done. remote: Total 2791 (delta 1722), reused 2513 (delta 1493) Receiving objects: 100% (2791/2791), 3.77 MiB | 969 KiB/s, done. Resolving deltas: 100% (1722/1722), done.
Create a gh-pages branch
Once you have a clean repository, you'll need to create the new gh-pages
branch and remove all content from the working directory and index:
cd repository git checkout --orphan gh-pages # Creates our branch, without any parents (it's an orphan!) Switched to a new branch 'gh-pages' git rm -rf . # Remove all files from the old working tree rm '.gitignore'
Tip: The gh-pages
branch won't appear in the list of branches generated by git branch
until you make your first commit.
Add content and push
Now you have an empty working directory. You can create some content in this branch and push it to your GitHub Enterprise instance. For example:
echo "My Page" > index.html git add index.html git commit -a -m "First pages commit" git push origin gh-pages
Your GitHub Pages site should now be available. If outbound email is enabled on your instance, you'll receive an email if your build is unsuccessful. For more information on enabling outbound email, contact your site administrator.
Load your new GitHub Pages site
After your push to the gh-pages
branch, your Project Pages site will be available at
'http(s)://[hostname]/pages/<username>/<projectname>/
, or http(s)://pages.[hostname]/<username>/<projectname>/
if subdomains are enabled (for more information, contact your site administrator)'
.