COMP 20: Web Programming

Lab: Git

Lab Objective

  1. Practice using Git and GitHub


In this course, you will be using Git and GitHub extensively to keep track of your work, communicate what you have done, work with teammates remotely (e.g., semester group project), and submit almost all assignments and labs. All assignments and labs in this course should be done on your local computer. That is, there is no need to connect to to work on assignments and labs unlike most other classes in our curriculum.

Please note that Git and GitHub are not the same. Git is the distributed version control system (software). Git is responsible for keeping track of changes to content (usually source code files), and it provides mechanisms for sharing that content with others. GitHub is a company that provides Git repository hosting. See for more insights.


Please read the following instructions first, carefully!

  1. Read Connor Taylor's (Tufts Class of 2015) Presentation on Git
  2. Create a GitHub account if you do not have one already at
  3. Read on setting up Git on your computer. If you are using Homebrew on a Mac, you can install Git via brew install git. Important Note: In this class, we will not be using the GitHub Desktop app. It isn't as flexible as using the command line and you need to get into the habit of typing and using the command line terminal.
  4. Read on creating a Git repository on GitHub. Please name this new repository hello-world under your account! Important Note: To avoid future confusions and Git conflicts, DO NOT initialize the repository with a README.
  5. Upon creating the hello-world repository under your account in GitHub, you will see a page that looks something like the following (with the exception of the mchow01 which is my GitHub username). Screenshot
  6. On your computer using the terminal / command line, create a new directory (a.k.a., folder) named hello-world via mkdir hello-world. This directory can be located anywhere on your computer. Then go into the directory via cd hello-world (cAsE sEnSiTiVe).
  7. In the hello-world directory, follow the instructions as noted on the GitHub page (or screenshot above):
    echo "# hello-world" >>
    git init
    git add
    git commit -m "first commit"
    git remote add origin
    git push -u origin master

    The first line echo "# hello-world" >> creates a file named with one line: # hello-world.
  8. Make a second commit change. That is: find a funny image (e.g., using Google), add it to your hello-world repo, commit and push change to GitHub. Please also write short, one line, coherent commit messages (i.e., no "dr. steve brule" or "asdf" garbage). Important Note 3: Please do not use photos of other students, me, or the TAs. That is just downright creepy.

Readings and References


This lab is worth 2 points.