GitHub: Create your unique repository

Github allows every user to host their site for free. The only catch is that you have to create a repo that is USERNAME.github.io.

Create a new repo that is an exact match of your username.

github

git init or git clone

1
2
3
4
5
6
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:USERNAME/USERNAME.github.io.git
git push -u origin master

Create an index.html

In your index.html, type Hello World!.

Create a CNAME file

Inside your CNAME file insert your domain name.

cname

Git add, git commit, and git push your changes

1
2
3
git add .
git commit -m "your commit message"
git push origin master

Namecheap

Go to “Manage Domains > All Host Records”

host records

Modify your domain name settings

Change @ to an A Record and IP/ADDRESS to Github’s IP/ADDRESS: 192.30.252.153.

Change www to CNAME and IP/ADDRESS to USERNAME.github.io..

manage domain

After your changes are saved, wait 5-10 minutes for yourdomainname.com to be hosted on github.