Git & GitHub Overview

Data Science and Visualization Institute for Librarians

Heidi Tebbe (anideaofhappiness) | Bret Davidson (bretdavidson)

bretdavidson.github.io/dsvil-github

The Plan

  • Why use version control systems?
  • What is Git?
  • What is GitHub?
  • Evaluating software projects activity.
  • Using GitHub without the command line.
  • Non-code uses for Git & GitHub.
  • GitHub web interface activity.

Objectives

  • Familiarity with some basic git concepts.
  • Awareness of alternative uses of git and GitHub.
  • Familiarity with GitHub web interface.
  • Experience evaluating software projects on GitHub.
  • Experience submitting commits and pull requests.

Caveat

This is an introduction!

Caveat

microsoft and github

Why use version control?

How to save documents!

  • annual.docx
  • annual_final.docx
  • annual_final_JC.docx
  • annual_final_JC_2.docx
  • annual_final_final.docx
  • annual_final_final_corrected.docx
  • FINAL_annual_final.docx

What does version control do?

  • Records the history of changes to a set of related files inside of a "repository".
  • Enables navigation of that change history.
  • Supports sharing of the repository among a group of collaborators.

What is Git?

  • Git is a distributed version control system.
  • Original author is Linus Torvalds, of Linux fame.
  • "I'm egotistical, and I name all my projects after myself."
  • git means "unpleasant person" in British slang.
git folder

Core Concepts

clone

obtain a copy of a repository

pull

update your local copy of repo to the latest version

branch

create a separate version of the files in the repo

commit

record a set of changes

merge

add your changes to 'master' branch

branching diagram
branch diagram
commit diagram
merge diagram

push

send your changes to the central or remote repo

What is GitHub?

  • GitHub is a Git repository hosting service.
  • Adds services on top of Git like issues, wikis, and social networking.

Critical Features of GitHub

  • Fork
  • Pull Request

fork

create a copy (clone) in order to make your own changes

use someone else's project as a starting point

propose changes to the original

pull request

mechanism for submitting your changes to original project

project owner "pulls" in your changes

Profile Page

profile example
stars example
following example

Repository Page

suma
suma star
suma contrib
suma nav
suma last
suma-doc

Activity

  • Project Health
  • Project Support
  • Project Documentation

Activity

Discussion

  • What did you learn?
  • How well did your project perform?
  • What questions do you have?

GitHub Desktop

desktop webpage

desktop.github.com

desktop windows example

windows interface

desktop create branch

create a new branch

desktop branch

view your branches

desktop clone

create, add, and clone repositories

desktop clone

clone a repository

desktop commit

commit

What else can I do with GitHub?

Referencing and Citing Content

Jupyter Notebooks

jupyter notebook example

Project Jupyter

Jupyter Notebooks

  • interactive environments that can contain executable code, rich text, mathematics, plots
  • uses include: data cleaning and transformation, data visualization, machine learning, instruction, etc.
  • support over 40 programming languages, including Python and R
  • Jupyter Notebook Viewer : free web service that allows you to share static versions of publicly available hosted notebook files
  • render directly on GitHub (interactive features won't work)

GitHub Pages

pages.github.com

suma-project.github.io/Suma

Data Visualization Workshops

Logistics

File and Repository Sizes

  • git : no file size or file number limits
  • GitHub repositories : < 1 GB
  • files added to GitHub via browser : 25 MB limit
  • files added to GitHub via command line : 100 MB limit
  • files stored using Git Large File Storage (LFS) : 2 GB limit

Public vs. Private

  • git : private
  • free GitHub account : public
  • paid GitHub plans (including enterprise) : public AND private
  • current students using GitHub : public AND private

Caveats

git folder
  • No ZIP files for folders
  • Not a digital asset management system
  • Licenses

Choose a License

license dropdown

Further Learning

Free Tutorials

Documentation

Alternatives to GitHub

GitHub Web Exercise

Questions?

bretdavidson.github.io/dsvil-github

github.com/bretdavidson/dsvil-github

GitHub Web Exercise