Create a Web Site for Your GitHub Repository

You can host a web site with GitHub that goes with your repository. This is a great way to show documentation, tutorials and so on for your project. GitHub gives you a web based tool to create a one page site. You can build a more complex web site from there. This post will show you how to do that.

Create the One Page Site

Log into Git Hub. Go to your repository’s page. Click Admin link. From the GitHub Pages section, click Automatic Page Generator. Feel free to enter some initial text for the page. Then click Continue to Layouts at the bottom. Choose a layout and click Publish. It takes about 10 minutes for the changes to take place. After that, you should be able to see your site. For example, if my repository is called MyProject, the URL will be

GitHub will create the necessary HTML and other files. They will be committed within the repository in the gh-pages branch. To manually maintain new pages and other files, you will need to work with that branch.

Manually Manage the Site

First, in your workstation, clone the gh-pages branch of the repository. For example, if your repository is called “MyProject”, run this command to clone it:

git clone -b gh-pages

Now, if you go inside the repository folder, you will see the web site files.

drwxrwxr-x 2 wasadmin wasadmin 4096 Nov 23 13:27 images
-rw-rw-r-- 1 wasadmin wasadmin 9176 Nov 23 13:30 index.html
drwxrwxr-x 2 wasadmin wasadmin 4096 Nov 23 13:27 javascripts
-rw-rw-r-- 1 wasadmin wasadmin 7527 Nov 23 13:27 params.json
drwxrwxr-x 2 wasadmin wasadmin 4096 Nov 23 13:27 stylesheets

Edit the files as you see fit. Then push the changes out to update the site.

git commit -a
git push origin

Refresh your sites web page to see the changes.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s