I also want to make fellow college students aware that something like Github Pages even exists. Too long have I watched them pay incredible amounts of money for hosting. I want them to know that with Github Pages, they can finally make a page that's as stripped down, simplified, and easy to load as their wallets.
EDIT: I think it would also be suitable to note here that Bitbucket, another popular repository hosting site, also offers the same hosting service. The major difference is that Bitbucket repos are private, and allow only up to 10 contributors in their free plan. I have used Github Pages here, but feel free to take a look at this page for instructions on how to set up a Bitbucket website.
The purpose of this introductory post is to run you through the setting up and initialisation of a PERSONAL Github Pages repository, something which the official Github Pages page already does more than admirably, so if you're looking for a good tutorial, follow that instead. If, for some reason, you find that tutorial too hard to follow, then this guide is fine, I guess. I'm mostly just setting up the scene for other stuff later, so if you're interested in the rest of this series of posts, then I suggest you follow along with this as well.
Setting up a Repository
The first thing you're supposed to do on your path towards greatness is set up a Github repository. Go to Github, create an account, and then create a repository. The name of the repository must, for some reason, be <your-username>.github.io, and this will also end up[ becoming the url for your Github Page website, so if you picked a silly username when creating your account, feel free to kick yourself now.Below are the options I ended up with - nothing really new here. Note that I chose not to initialise the repository with a README.md, which isn't really standard practice. If this is your first experience with Git, I suggest you do so.
Get Git on the command line
This is really more of an intermediary step than anything, but it is critical that you actually have Git in order to work with Github Pages - it's the version control software through which all updates to your potential website will be maintained.
Ubuntu users, as always, have the handy apt-get command:
If you're a Mac user, youare probably rich enough to pay for hosting will have to take a look at an external resource to find out how to install Git, like this one.
sudo apt-get install git
Whereas Windows users will have to get the immensely useful Git Bash.If you're a Mac user, you
Clone the repository you just created
If you carried out the previous step correctly, then this one is fairly easy. Navigate to a preferred storage location on your hard disk, and clone the repository onto your hard disk. If you installed git properly, this is the command you must put into your bash terminal:
git clone https://github.com/<your-username>/<your-username>.github.io.gitHere's what I had to input, for example:
git clone https://github.com/clennam/clennam.github.io.git
Create a test file
Now you've cloned the repo into your hard drive. You shouldn't have much in there already, seeing as you just cloned an empty repo.Create a simple html file, so that we can push it and see if our brand new site works as advertised. You could open a text editor, create an html file, and save it into the repository folder, but you can simplify all this into one step on Ubuntu and Windows by doing this right from the command line:
echo message > filename.htmlOr, in my case:
echo This is a test message > index.html
Commit and push the files
Our setup is all done, it is now time to push the files to the local git repository, and from there, send them to the online repository that we created.
This is really simple in practice, although there is quite a bit of complex theory behind it. The commands you need to run, in order, are:
git add .
git commit -m "Initial commit"
git push -u origin master
yey.jpg (ironically, the picture attached is a .png)
You're all done! Check if your new site is set up properly by going to the URL <your-username>.github.io. Here's what I got:
Take it as a keepsake of our beautiful time together. |
Watch this blog for the next post in this series, in which I continue exploring the possibilities of this platform.