Ad code

How to create github gh pages for website hosting in 2019

If you are student of HTML, CSS and JavaScript for website developers course creating github pages become problem. This is because the course lectures was created before github lastest update. This information will guide you.

How tp create Pages in github

Followed this steps to create github gh-pages in 2019.

1. Install github pages in Window or Mac and Sign Up Github account if you don't have.

2. Prepare your website documents like html, css, js and images files and add all in one folder.

3. Note that html files will be placed direct in the folder while css, js and images will be placed in sub-folder. See image below.

4. The folder's name you created in no 3 above will be your github account repository name.

5. Create your project repository in github account with same name as your website folder in local hdd.

6. Open the folder where your website files are in local machine.

7. Right click and select Git Bash here. Then type these commands. Note the comand is character sensitive. Put "." and "space" where it should be.

a) git init

b) git status

c) git add .

d) git commit-m "first commit" .

e) git status

login will pop up for your github details

f) git config --global "email"

g) git config --global "name"

h) git status

copy url from github. See image

i) git remote add origin

j) git push -u origin master

in case you get this error src refsrc then commit your file again

k) git commit-m "first commit"

Enter your github user mame and password again. 

You have created your page. Go to github>>settings scroll down to gh-pages and select masters.

Open your website. 

Learn How to host domain name on github here.

Post a Comment