Ok so I had the site, and it is dynamic. Whenever I upload a new piece of work on Behance it updates my website too - nice.

But it is still on my mac. That is not very helpful for the rest of the world, who would have to wait until I turn on my mac to see it. Hmm we need a host.

As the site is making its dynamic calls using javascript we no longer need to worry about finding a hosting package that includes a server side language like php or database functionality like mySQL.

Awesome now I can use GitHub!

So how do I get my site online? Here is how I did it.

  • The first thing you need is a Github account. Remember to verify your email!
  • Next you need to make a respository. It is pretty easy, just click the button.

    Ok from here you have 2 options. You can use the terminal (command line if on PC ) to push files to this space or download the Github application for your system.

    I used the method which made the most sense to my workflow, which in this case was the terminal.
    An obvious point to note is that your website should be all in 1 folder, just in case you have missed that very basic web design step.

    Ok in the terminal change to your project directory/folder by passing this simple command:

        cd /insert/your/project/directory/portfolio
    

    A nice trick, to save your fingers typing out every path is just to type cd in the terminal, find the folder and then drag it into the terminal window. Boom you have the path.

    Now hit enter. You are now inside your website folder.
    Ok we need to initialise Git pass the following command by typing and hitting enter... From now on assume if I say pass a command that you hit enter... cool? ..Great.

        git init
    

    We now need to setup a remote origin. This basically tells Github where the files that will be in your repository came from.

         git remote add origin https://github.com/yourUserName/YourRepositoryName.git
    

    Awesome you are doing really well, next we need to make a branch to store our files withing the repo. To do that you pass the simple command:

        git checkout -b -gh-pages
    

    This makes a new branch with the parameter -b with the name gh-pages. This is really important. In Github there are 2 types of pages: User and Project. You can only make 1 user page BUT your can make as many project pages as you need. If you do not call the branch for your site gh-pages it will not work.

    If you need to check the status of your repo, like did I delete or upload files you can by passing:

        git status
    

    Run this command followed by:

        git add .
    

    Remember the . this adds all the files in the directory. Only two more commands and you will have a fully functional website!!

    Next up we need to tell Github why these files were uploaded. So we might give it the tag original or version 1 or something meaningful to you.

    When you have thought of something pass this command:

    git commit -m "orignal commit"
    

    As you can see, I'm just giving mine the tag original commit.
    Finally we need to "push" the files to Github with one single final command:

    git push origin gh-pages
    

    You will probably see lots of file paths whoose up the terminal window. Don't fret that means that it is working. You will be able to see how fast the transfer is in the final lines of the terminal.

    Upon completion you must wait 10mins before your site is live. You can check that the files entered your repository correctly by navigating to your github page and clicking on your repo.

            github.com/yourUsername/yourRepositoryName