COMP 20: Web Programming

Lab: Git

Lab Objective

  1. Practice using Git and GitHub

Overview

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 homework.cs.tufts.edu 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 https://programmers.stackexchange.com/questions/173321/conceptual-difference-between-git-and-github for more insights.

Instructions

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 https://github.com/.
  3. Read https://help.github.com/articles/set-up-git 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 native 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. Generate an SSH key. "SSH keys are a way to identify trusted computers without involving passwords." Read https://help.github.com/articles/generating-an-ssh-key/
  5. Read https://help.github.com/articles/creating-a-new-repository/ 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.
  6. 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
  7. 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).
  8. In the hello-world directory, follow the instructions as noted on the GitHub page (or screenshot above):
    echo "# hello-world" >> README.md
    git init
    git add README.md
    git commit -m "first commit"
    git remote add origin git@github.com:your_github_username_here/hello-world.git
    git push -u origin master
    

    The first line echo "# hello-world" >> README.md creates a file named README.md with one line: # hello-world.
  9. 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

Assessment

This lab is worth 2 points.