Lecture 5: Version Control

DSCI 100

Housekeeping

  • Project introduction this week!
    • No tutorial assignment on the topic of version control.
    • Work on your project and complete up to CHECKPOINT A.
  • Midterm will be held on next Tuesday June 2nd, and starts at the beginning of your section’s lecture period.
    • The midterm will be a closed-book Canvas quiz
    • You will have access to a reference sheet of R functions, use this to practice the exam
    • You will have to install the Lockdown Browser - more information to come!
    • Use the iPhone survey to test your system

What is version control?

  • Version control: the process of keeping a record of changes to documents, including when the changes were made and who made them
  • lets you view earlier versions and revert changes
  • facilitates resolving conflicting edits
  • originally for software development, but is now used for many tasks (e.g. data analysis!)

Why do we need tools to help us collaborate?

No big deal. Just send files to your teammates in emails. Right?

Why do we need tools to help us collaborate?

Problems with emailing as version control:

  • which version is the newest?

  • who made edits, when where they made?

  • what were you working on? (when you revisit the project 3 months from now)

  • can’t easily revert changes (if something breaks)

  • no sane way to discuss todo items, issues, etc.

Why do we need tools to help us collaborate?

OK, fine. Then let’s just share and edit files on dropbox/google drive. Right?

These solve only the problem of knowing which version is the newest

Still:

  • can’t tell who made edits, when they were made

  • can’t tell what you were working on when you revisit the project 3 months from now

  • can’t easily revert changes

  • no sane way to discuss todo items, issues, etc

(and honestly, you still usually end up with final_revision_v3_final.docx…)

Git and GitHub

In this course we use two major tools for version control

Git

Git is a version control system that:

  • Keeps track of files in a repository (a folder that you tell Git to pay attention to)

  • Tracks of changes

  • Shares files with others

  • Handles conflict resolution

  • Runs on your (and your teammates’) local machines (collaboration)

GitHub

GitHub is a cloud-based service that hosts your repository which:

  • Helps manage permissions (who can view your project, who can edit it)

  • Provides tools for project-specific communication (organized into issues)

  • Can be used to build and host websites/blogs

Key version control concepts and commands

Notes:

Key version control concepts and commands

Notes:

Key version control concepts and commands

Notes:

Key version control concepts and commands

Notes:

Key version control concepts and commands

Notes:

Key version control concepts and commands

Notes:

Key version control concepts and commands

Notes:

Demo time!

Let’s get a repository made for our projects. Follow along!

Need a refresh? Check out this YouTube video made for the DSCI project.