Github basics

by Elliott Hauser

22 Sep 2022

Can I Get A Volunteer?

We’re going to help Tommy the Tester create his first post.

  • Create Github account. In the below, substitute your actual Github account name (which is case sensitive), for yourgithubname. That’s in both the filename and author: entry
  • Go to https://github.com/inf380p/inf380p.github.io. You should see the Code tab highlighted (Not Issues or Pull Requests)
  • From the Add File dropdown, select Create New File
  • This new file will become your post. Give it the filename _posts/yourgithubname/2020-08-26-first-post-<username>.md Remember the importance of careful typing
  • Add this to the top of the file’s text content:
---
layout: post
author: yourgithubname
title: "Yourname's first post!"
---

Remember, every character matters to a computer.

  • Then, underneath that header, write a bit about yourself.
  • Write a commit message in the first text box under the “Commit New File” heading at the bottom of the github page describing what you did, like “Added Tommy’s first post”. You can leave the second text input box there blank.
  • Look good? Create Pull Request. Or edit again if something’s wrong.
  • Your commit will now show up on your Pull Request and automated tests will begin to run.
  • :+1: :sunglasses: :fire:

Automated Tests

We use Travis-CI to automatically run tests on code. When you submit a pull request, you’ll see something like this:

Behind the scenes it’s building a whole new server and running various tests to make sure your code won’t break the site. You’ll want to make sure your code passes these tests, after which you’ll see a shiny green check mark next to your pull request. The test status is also visible in the list of pull requests:

If your build fails, don’t panic! It happens to the best of us. Click ‘Details’ and see if you can figure out what went wrong.

Also, remember that passing tests is a minimum standard. It doesn’t mean that your code is perfect, so make sure to read over your code carefully.

Elliott Hauser is an Assistant Professor at the UT Austin iSchool. He's hacking education as one of the cofounders of Trinket.io. Find Elliott Hauser on Twitter, Github, and on the web.