iOS engineer who likes clean, simple designs and sans-serif.

Loading

Hosting Pages on Github

Today I saw a sample portfolio piece being hosted on Github. This sparked my curiosity so I decided to try to figure out how to host my Front End Web Development project on Github.

I did some quick research and discovered Github Pages, which told me this was possible. I figured I could override the default content with my project.

Some quick googling yielded this article on GitHub Pages Workflow. Aha! PS – Understanding basic git and github was SUPER helpful for this. Specifically, I tried the below:

$ git checkout gh-pages // go to the gh-pages branch
$ git rebase master // bring gh-pages up to date with master
$ git push // push the gh-pages branch changes to GitHub Pages
$ git checkout master // return to the master branch

Unfortunately, I kept getting errors on the rebase. (Because my gh-pages and master originated separately?) So I just deleted all the files and did a traditional merge:

// Delete files from gh-pages
git checkout gh-pages
git rm -r *
git commit -m "Deleted all files from gh-pages"
git push

// Merge master and gh-pages
git checkout gh-pages
git merge master
git commit -m "Merged with master"
git push

And booyah, all done!
Project can be found here: CSSettlers

Leave a Comment