Skip to article frontmatterSkip to article content

What are Git and GitHub?

Git is a version control software that tracks changes in files and allows multiple users to work on the same files in parallel smoothly. Git is often used in conjunction with GitHub, a website that hosts code and files. A repository (aka repo) on GitHub holds the files for a specific project. GitHub’s web interface also displays the information that Git tracks, such as which users are working on a file and what changes have been made to the file.

Why should I store materials on GitHub?

Storing materials on the GitHub allows you to use hyperlinks for assignment distribution. It also allows you to use the version control features that Git provides. Use of both public and private repos centralizes course material across semesters.

Using GitHub

You can perform many actions such as uploads and downloads directly through GitHub’s web interface directly, without having to use the command line interface. Here are some directions on how to upload assignments to GitHub. If you did your development on JupyterHub, download the notebook onto your computer. Then, go to your connector’s GitHub repository and click Upload Files on the right side.

You can drag and drop your desired files onto the page. Then, write a short sentence describing the files you’re adding. This short sentence is called a commit message.

You will then see an option to select the branch for your changes. The default for most repositories will be the master branch. If you are a Git beginner, you can stick to the default and add your changes to the master branch. If you are a more advanced Git user and want to use different branches, you may want to select the option to create a new branch. Please see the additional GitHub resources on this page to learn more about branching.

Once you’ve gone through the above steps, you can save your changes. A set of changes in Git is called a commit.

Using git

GitHub can also be used via the command line. We will not go into the details of how to use Git in this guide as there are many online resources on this topic. One resource for using Git over the command line is linked at the bottom of this page.

You can store your connector’s Git repository locally and use a local terminal application to access the command line. You can also store the repository on datahub.berkeley.edu and use the terminal that is present on the JupyterHub. You can access the terminal on JupyterHub by clicking on the New dropdown, and then clicking on Terminal.

You will then see a terminal page in the browser.

Additional Resources

Web Interface

  • Managing Files - contains information under the “Managing Files on GitHub” section on how to perform many basic file operations using the GitHub web interface.

  • Hello World Exercise is a short exercise that walks you through additional GitHub features such as branches and pull requests.

Command Line

Desktop GUI