GitHub - Lecture 1

Goals

In this lab, you will get an overview of GitHub collaboration tools.

  • Use the discussion board
  • Check your dashboard and notifications
  • Explore files in a repository
  • Create an empty repository and add a file
  • Edit your user profile and add a profile page

GitHub

GitHub allows you to store files in “repositories”, which is like a folder. This is a popular way that code is shared and there are many community resources shared on GitHub that you will want to be able to use in your JupyterHub. You can also link your own GitHub repositories to your JupyterHub.

Being familiar with GitHub is important for reproducible science because GitHub is widely used for sharing code and tutorials. You can easily “pull” code in GitHub repositories into RStudio (and any other coding platform like Visual Studio Code or Jupyter Notebooks). Learning version control (Git) will allow you to work more efficiently and to collaborate with others in the larger research community.

We will cover using Git in Lecture 2.

What is GitHub?

GitHub is a hosting service for Git repositories, enabling us to share code across teams in a web environment.

Why do I need a GitHub account?

  1. Your GitHub accounts will give you access to the hackweek cloud computing resources
  2. All hackweek tutorials will be shared on GitHub
  3. All project teams will use GitHub to collaborate and work together on their code
  4. GitHub is widely used to share code across the geosciences. If you don’t know how to use GitHub, you are missing out on a wealth of community shared knowledge.

Creating a GitHub account

Go to GitHub. Next, enter your email address and click on the green ‘Sign up for GitHub’ button. You will need to answer a few required questions in the following dialogs.

Following your GitHub activity

Managing GitHub notifications is important and you probably don’t want all notifications going to email. Only have things you really don’t want to miss going to notifications.

  • Notification dashboard: https://github.com/notifications
  • Changing your notifications settings
  • News dashboard https://github.com/dashboard

Repositories

Each repository is a container for a specific subset of material. GitHub is widely used to share code and tutorials! Let’s explore the content for

Machine Learning in Environment Science, an recent course by Ben Best at University of California Santa Barbara. GitHub repo

Activity

  1. Look at files
  2. Download a file
  3. Look at files at an earlier time
  4. Look at what changes have been made

Create a repository

Core skill

Create a new repository in GitHub by

  • Navigating to your user profile page (click on your image in top right)
  • Click the repositories tab in your profile
  • Click the green New button and add a README
  • Add files

Activity

Create a profile page for your GitHub account. Already have one? Be a helper for this exercise!

  1. Create a repository and give it your username as the name. For example, mine would be named eeholmes
  2. Add a file by clicking “Add File” and name the file “README.md”. This will become a profile page for your GitHub account.
  3. Add some text to the README. You can use this as a template or use one of the many examples of profile READMEs that you can copy here: https://github.com/abhisheknaiidu/awesome-github-profile-readme

Example profile README

### Your Name 

- :school: I'm a student at **XYZ** in this city.
- 🔭 I’m currently working on  **XYZ**
- :game: When I am not working, I like to **XYZ**
- At the Hackweek, ask me about <some areas of expertise>

- 🌐 Visit my [website](https://eeholmes.github.io//) for complete background and contact.