Git and GitHub Workshop

Workshop: Data Science Tools

Tyler George, Cornell College

Create GitHub accounts

You can create a free account at: https://github.com/

Git/GitHub terminology

  • repository (files, their relationships, and their history)
  • clone/fork (copying repos)
  • pull (refresh your copy)
  • pull-request (request your version gets merged back to the source)
  • commit (changes to repo)
  • push (push local the changes back to the source)
  • merge (combine versions of files or repos)
  • master/main (root directory of most git repos)
  • branch (version of repo diverging from the original)
  • fetch (update cloud version to your version)

Definitions at: https://www.pluralsight.com/resources/blog/cloud/git-terms-explained

GitHub Workflow

Credit: Robert B Cohen

How do you…

  • Create a repository
  • Open or view issues
  • Clone a Repository
  • Star a Repository
  • Fork a repository
  • Place a pull-request

GitHub Workflow

Credit: Robert B Cohen

Collaborate on repo - Follow Along

  • Fork repo: https://github.com/stats-tgeorge/G_GH_Workshop_2024.
  • Click peoples_bios folder
  • Click Add file, then create new file on the right
  • Name your file with your last name, first initial (at the top). Example: George_T.md
  • Write your bio in the document
  • Click Commit changes… on the top right. Then Commit changes
  • Navigate back to the main page of your Fork of the repo by clicking its name at the top
  • Click Contribute in the middle of the page and then Open pull request
  • Click Create pull request at the bottom.
  • Update your fork by clicking the Sync Fork button on the repo homepage at https://github.com/stats-tgeorge/G_GH_Workshop_2024.
  • Your Task: Fix my typos in the opening overview presentation I gave. The filename is Intro_Git_Github.qmd. You will need to edit that file, commit the changes, and then create a pull-request.

Accepting Contributors Work

  • The owner of the repo can accept your pull-request and add your changes to the main repository

  • This is just one way to use version control and collaborate on GitHub!

More Collaboration

Revert a change

  • Reverting a change is one of the most important features of version control.

  • Right now, it not possible on GitHub’s website

  • I will show you how to revert a change on the GitHub desktop app

Teaching GitHub

  • Git/GitHub need to be learning objectives (Beckman, et. al, 2021)
  • Use it to enhance learning and collaboration
  • Give students a tasks that necessitate a team and the GitHub tools
  • Projects and Kanban Boards

Using GitHub to Teach and More (1/2)

Using GitHub to Teach and More (2/2)