MTH 209 Data Manipulation and Management

Lesson 15: A Quick Overview of GitHub

Ying-Ju Tessa Chen
ychen4@udayton.edu
University of Dayton

Overview

In this session, we will provide a quick overview of GitHub. It will cover some basic usages of GitHub Desktop due to the time limitation of the class.

What is Git?

Git is a version control system that allows us to track changes in any set of files. It is typically used by programmers who are working on source code together.

What is GitHub?

GitHub is a version control and collaboration tools for programming. It allows us to collaborate on projects from any location with other people.

Register for a GitHub account

We can register for a GitHub account at www.github.com.

Install and Set up GitHub Desktop

Installing GitHub Desktop from https://desktop.github.com/

GitHub

We will create a process that shows how to create a repository, track changes, and explore a file’s history.

GitHub Desktop

Here is an example that shows how GitHub Desktop looks like.

  • Current repository
  • Current branch
  • Fetch origin

Fetch downloads the most recent updates from origin but it does not update our local working copy with the changes. After we click Fetch origin, the button changes to Pull Origin. Clicking Pull Origin will update our local working copy with the fetched updates.

  • Summary (required) & Description (optional)
  • Commit to master

When we commit the changes, the list of uncommitted changes was gone from the left pane. We have, however, just committed the changes locally. The commit must be pushed to the remote (origin) repository.

Use GitHub Pages to Publish a HTML File

The html file needs to be named as index.html.

  1. Sign in our GitHub account at www.github.com.
  2. Navigate to the repository where our html file is.
  3. Click Settings and find Pages from the left menu.
  4. Under “GitHub Pages”, use the None or Branch drop-down menu and select a publishing source.
  5. Click Save.

Note: It may take a few minutes to have the webpage available online, depending on the HTML file size.

Use GitHub Pages to Publish Several HTML Pages

One can find that it is less effective when creating a repository for posting only one HTML file. There could be a situation where we have to post multiple HTML pages. There is an easy way to do this. This also applies to the situation when one webpage is posted.

  1. Head over to GitHub and create a new public repository named username.github.io, where the username is our username on GitHub.

  2. Go to the folder where we want to store our webpages.

  3. Add the HTML files.

The webpage is available at

https://username.github.io/folder/filename.html.

For example, all the class lessons are stored in the the folder teaching/MTH209 in the GitHub repository ying-ju.github.io. The webpage for this lesson is

https://ying-ju.github.io/teaching/MTH209/Lesson15.html.

README

You can utilize the following single character keyboard shortcuts to enable alternate display modes (Xie, Allaire, and Grolemund (2018)):

Xie, Yihui, Joseph J Allaire, and Garrett Grolemund. 2018. R Markdown: The Definitive Guide. CRC Press.