Git and GitHub Tutorial#

The NCAR/UCAR virtual Python Tutorial Seminar Series continues with an introduction to the Python package Git and GitHub on Wednesday, May 12th at 1 PM Mountain. This session will be led by Kevin Paul.

The purpose of this seminar is to cover just some of the common content needed to understand and use git and GitHub for collaboration on software. This is not meant to be an introduction to git or GitHub.

Assumptions of past Git experience#

We assume that you understand these basic Git commands:

  • Creating a git repository with “git init”

  • Staging changes to a git repository with “git add”

  • Committing staged changes to a git repository history with “git commit”

  • Checking the status of a git repository with “git status”

  • Looking at the commit history of a git repository with “git log”

These commands let you create and make changes to a Git repository that are tracked so that previous versions of the repository can be retrieved.

We also assume that you have a GitHub account and that you are familiar with the basic GitHub layout. We assume that you understand the following Git common commands for interacting with a GitHub repository:

  • Cloning a GitHub repository with “git clone”

  • Pulling new commits from a GitHub repository with “git pull”

  • Pushing new commits to a GitHub repository with “git push”

If you are not familiar with these commands, I recommend that you watch the “Your First” tutorial serial videos and/or follow along on our website.

Covered in this tutorial#

Since the goal of this tutorial is to teach how to collaborate on software with Git & GitHub, we will cover the basics necessary for collaboration (beyond the basic commands detailed above). This means we will cover:

  • Git branches:

    • Creating a branch

    • Merging one branch into another

    • Deleting a branch

    • Dealing with merge conflicts

  • GitHub fork-based workflow:

    • Creating a fork of a GitHub repository

    • Dealing with git remotes

    • Pull Requests

    • Code Reviews

Preparation before tutorial#

You do not need to do anything before the tutorial to prepare, though you will need a machine with git installed, a GitHub account, and the aforementioned understanding. If you want to be a little ahead of the game, please feel free to clone the following repository:

There will be many changes to this repository before the tutorial, so I recommend that you either wait to clone this repository or do a git pull just before the tutorial begins.

Sign Up#

If you would like join the Google group to be informed of updates and events in the seminar series, please do so by following this link and clicking “Join Group” next to the group name.