Introduction to GitHub


Joey Takeda, DHIL, Simon Fraser University

DISA, University of British Columbia, February 7, 2025


Unceded territory of the səl̓ilw̓ətaʔɬ (Tsleil-Waututh), kʷikʷəƛ̓əm (Kwikwetlem), Sḵwx̱wú7mesh Úxwumixw (Squamish), and xʷməθkʷəy̓əm (Musqueam) Nations

Agenda

(If you haven't yet, please sign up for GitHub account!)

  1. What is version control / Git / GitHub?
  2. Introduction to Project Setup
  3. Getting Started

What is Version Control?

  • Software that records and stores changes
  • Formerly the domain of programmers (Subversion, Git, etc), but now widely used
  • Google Drive, Dropbox are kinds of version control

What is Version Control?

  • Data should be versioned using a version control software
  • Version control means every version of every file is retained
  • So no need for Draft-NEW, Draft-NEW-Revised, My-File-REVISED-Final-JANUARY, etc

Why use Version Control?

  • Reliable (every version of every file is retained and is easy to rollback)
  • Distributed (usually pushed to some central host/hub)
  • Documented (each change is accompanied by a description)
  • Collaborative (what is recorded are changes, so allows for many kinds of changes by many people)

Git

  • Developed for keeping track of Linux development (~2005)
  • Free and open source software
  • A command-line tool, but one integrated into a number of programs and interfaces (e.g. oXygen, GitHub Desktop)

Git

"git" can mean anything, depending on your mood.

  • random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronounciation of "get" may or may not be relevant.
  • stupid. contemptible and despicable. simple. Take your pick from the dictionary of slang.
  • "global information tracker": you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room.
  • "goddamn idiotic truckload of sh*t": when it breaks
Linus Torvalds, git/README (2005)

How it Works

  1. You create a repository (i.e. a folder with all of your stuff)
  2. Make changes to that repository and save it locally
  3. Then you commit that change to the repository (i.e. stage that a change has been made) along with a message saying what you changed
  4. Then you push those changes back to the repository
  5. Anyone else working in that repository (or if you're working on a different computer) would need to pull the changes from the repository before making new changes

How it Works

Really, this is just the same as emailing a file to yourself or sending an article for revisions

  • First you write things
  • Then you send it to the journal
  • They then send it to an editor who may also make changes
  • The editor sends it back to the journal
  • The journal sends it back to you

Other Relevant Terms

  • Branches and forks make Git much more powerful than sending emails to yourself
  • Branches = many editors making different track changes, which then can be sent back and merged into the one article
  • Forks = a special kind of branch that is disconnected from the main repository. E.g. an editor making a photocopy, making changes, and then possibly sending it back (or just keeping it to themself)

Version Control Practices

  • Incremental changes better than large ones
  • Best for text, data, or other small to medium size files; things that are subject to change in ways that are understandable by the computer
  • Larger binary files (e.g. PDFs, images, videos) less appropriate

GitHub

  • GitHub is a central hub for hosting and making Git repositories available
  • Web interface for hosting and sharing code / data / files
  • Has a wide range of different organizational features

GitHub

  • Free or paid accounts (paid = private repositories); academic accounts available as well

Questions so far?

DiSA-DHIL GitHub

https://github.com/DiSA-DHIL

Co-Lab GitHub

  1. Introduction to the organization/repositories
  2. Creating your own using the template
  3. Introduction to the template
  4. Creating a personal access token
  5. Cloning the repository in oXygen
  6. Create your first person