This is the first in (hopefully!) a series of posts introducing tools that I have built for helping teach coding better to adult beginners. I’ve been reading some great product stories here on Medium and I’ve come to believe that every awesome “thing” you make (not necessarily a product) starts with a good backstory. Here goes nothing…

The Reason.

GH Pages is one of my favorite GitHub features. It’s incredible to be able to deploy static content that can optionally be CNAME’d to your own domain.

As a web development teacher, it is an absolutely essential tool that clearly helps demonstrate the usefulness of Git as a platform and allow students who are learning to code show off their work.

However, the main issue is that pushing a repo to GH Pages can be a bit of an arduous task.

Here are the steps required:

Clone your repo

$ git clone github.com/your_user_name/your_repo_name.git

$ cd your_repo_name

Create a new orphan branch

And then kill whatever is in your directory already.

$ git checkout --orphan gh-pages

$ git rm -rf .

Add your content, commit, then push back to GitHub

# make some file changes, add content etc

$ git add .

$ git commit -m "deploying to the internets! huzzah!"

$ git push origin gh-pages

For an average programming beginner, it’s a bit much to ask (on top of asking students to git add / git commit stuff on a regular basis anyways).

Plus, it’s a bit annoying to have to do that every time you need to push a page out to GH Pages.

The Fix.

As it turns out, the GitHub API supports performing all the tasks above through POST / PUT / etc requests!

And so, enter GitBot.

GitBot pulls in all of your git repos into a tidy list. Choose the repo you want to push out to gh-pages and click. GitBot automagically performs the steps outlined above for you and deploys your repo. All you need is one click to go from repo to deployment on GH Pages.

The Awesome.

Hmmmm so why should you use Gitbot? (#segueWithRhetoricalQuestion)

Teaching! Use GitBot to get students into the habit of git commit-ing and git push-ing their work. Collect homework by requiring students to use GitBot to push their repos to GH Pages and submitting the URL. Static site generators. There are a lot of good ones. If Jekyll isn’t really your thing, but WinterSmith warms your soul, static site generate away! Just push all your files to a repo and use GitBot to deploy.

The Nitty-Gritty.

First, check out the homepage.

The green button is where it’s at.

Authenticate!

Peep dat repo list.

Give it a second tho; the API call to list your repos doesn’t always load immediately.

Choose a repo.

Last updated repo shows up first.

Watch it build!

???

(Give it a few seconds to build — GH Pages seems to have a 2 to 3 min cache, so the site won’t immediately show up after build).

Profit.

The closer.

To date, GitBot has been used by a few generations of my FEWD students to deploy homework assignments and final projects. Plus, I use it all the time to deploy my lecture content (which are built usually with one of my static site generators).

Under the hood, GitBot is a static app. In other words, it’s a purely browser-side javascript site — just like the webpages it deploys to GitHub. (I’ll follow up with a post chronicling some of the interesting problems that popped up in the pursuit of building GitBot as a purely static app in the coming weeks).

Ok that’s it! Happy git committing, folks.