Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Git and GitHub: Getting Started

Before we set up your coding environment, let’s clarify what Git and GitHub are:

You’ll use Git to download course materials and work on your homework assignments throughout the term.

GitHub is a web-based application and does not require set-up. Since you will be cloning the course GitHub repository in order to run the lecture notebooks locally, you need git installed locally. Follow the instructions below for this.

Option 1: GitHub Desktop (easiest)

If you’re new to the command line, you may prefer GitHub Desktop. It provides a simple interface for working with Git and GitHub.

That said, we recommend at least some familiarity with the command line version, since it’s widely used in data science and software development.

Step 1: Install Git

Follow the instructions for your operating system:

macOS

Open Terminal (Applications –> Utilities folder or search with Spotlight). From the terminal, run the command:

xcode-select --install

This will install git and many other very useful applications as well (including make).

Ubuntu Users

Open the terminal and install git using your system package manager. For example

sudo apt-get install git

should do the trick on Ubuntu.

Windows Users

This will install Git and also give you a Git Bach terminal, which provides a Linux-like environment on Windows.

If the above does not work for you, follow the installation instructions here.

Step 2: Testing your Git installation

Open your Terminal (or Git for Windows) and run

git --version

If you are returned the version of git, it means your install was successful!

Step 3: Authenticating with GitHub (important!)

For cloning public repositories (like the course repo), no authentication is needed. However, for pushing changes to your private homework repository, GitHub requires authentication.

You have two options:

  1. Personal Access Token (PAT)

    • Easiest for beginners.

    • You’ll log in with your GitHub username and a token (instead of your password).

    • Follow GitHub’s guide: Creating a personal access token.

  2. SSH Keys

Our recommendation: use [choose one: PAT or SSH depending on what you prefer for this class]. If you get stuck, bring your laptop to tutorials or office hours, and w’ll help you set it up.

That’s it! With Git installed, you’re ready to clone the course GitHub repository and start working on your homework assignments.

Learning git

There are many free online resources for learning git. One possibility is the Software Carpentry git tutorial.