Computer Science Mojo

~ David's Notes on coding, software and computer science


How to host Project Website on GitHub Pages

Category: Git     Tag: GitHub   Web  
By: David     On: Mon 07 September 2015     

You can host static websites freely on GitHub Pages. They are awesome!


1. Clone repo

2. Create gh-pages branch

git checkout --orphan gh-pages

3. Remove the previous stuff

might not need to if it's a new repo

git rm -rf .

4. Push

git push --set-upstream origin gh-pages
git push origin gh-pages

5. Custom domain

5.1 CNAME file in repo

in the repo, gh-pages branch, create a file named "CNAME" with a simgle line of your custom domain name ""

5.2 DNS settings at your DNS provider

For apex domain, create A records:



For subdomain, simply create a cname file pointing to