How
to host my website in GitHub for free
To host your
website in GitHub you don't need to be a programmer and you don't even need to
touch the command line you can do it .So first you need to go to the github.com
and create a GitHub account. Then click on the “+” sign on right top corner of
your account and create a new repository.
Then give a
name to your repository and it’s up to you but make sure it’s memorable and
short. Next you have to make your repo public (If you select privet you have to
pay).Before create the repo initialize it with a README .Finally click on
create repo.
After you
finish it your repository will be look like this.
Then download GitHub client for windows https://windows.github.com/ (There is a client for mac https://mac.github.com/ too).Then go to your GitHub in windows.
Click on the plus sign on left top corner of
your GitHub window & then click on clone.
It will display
the set of repositories in your GitHub account.In my case I will select the test
and click on clone test.
Select a location in your local machine to
clone the repo.After you select the location GitHub client will automatically
clone the repo into the local machine.
After finish the cloning .GitHub window will
show the content of GitHub project as below.
Now we need to create a GitHub pages (GitHub
Pages are public webpages freely hosted and easily published through GitHub
site).In the above picture you can see a small dropdown icon with the name of “master”
.Create a new branch as gh-pages as I express below.
Then add your website (js, css, html files)
to the GitHub folder in your local machine (where you clone your GitHub repo).But
make sure that your homepage named as index.html.
In your windows GitHub client will display a
message about uncommitted changes.
Click on uncommitted changes and add a
meaningful commit to it like “Adding my site”.
After adding your commit click on publish
icon on right top corner. Now go to your online GitHub repo and refresh it.Then
you will see there are two branches. Just click on it and go to gh-pages.(No
need of following this step ,it just for enjoying your work J).
Wait for 10
minutes and type
http://your user name.github.io/your repository name/
Here are some
small things I have done using GitHub
I think you may interest to read this
No comments:
Post a Comment