Navigate
Back to Gym
← Back to Wall

GitHub Basics: Colab edition

Route ID: R007 • Wall: W03 • Released: Jan 1, 2026

5.7
ready

🧗 Start Here

Scroll down to complete this route

Route 007: GitHub Basics: Colab edition

  • RouteID: 007
  • Wall: GitHub Basics: Colab edition
  • Grade: 5.7
  • Routesetter: Srikar + Adrian
  • Time: ~30-45 minutes

Introduction

Description: Hands-on introduction to Git & GitHub using simple clone, commit, push, and pull workflows. This route focuses on building comfort with core Git concepts while working in your own repository.

Prerequisite: 🔑 Complete R006: GitHub Basics (Local Terminal Edition) (Which goes over GitHub account setup & authentication - but focuses on using Github locally in your machine.)

Introduction: What is GitHub and why are we using it?

What is GitHub? At a high level, GitHub is a place where people share, track, and collaborate on code and data. You can think of it as:

  • A Google Drive for code, plus
  • A time machine that remembers every change, plus
  • A collaboration layer that lets many people work on the same project without overwriting each other

Behind the scenes, GitHub is built on a tool called Git, which keeps track of versions of files over time.

What is a “repository”?

A repository (often called a repo) is just: A folder that Git knows how to track. A repo usually contains:

  • Code
  • Data or configuration files
  • Notes or documentation
  • A history of how everything changed

Learning Objectives

In this route, you’ll work with a very small repository so you can focus on the ideas without getting lost in complexity.

Why we’re learning GitHub in this course

If you’re doing anything serious with machine learning, computational biology, or chemistry, you’ll eventually need to answer questions like:

  • Which version of this code produced this result?
  • What changed between two experiments?
  • How do I share my work cleanly with others?
  • How do I build on code without breaking it?

Git and GitHub are the standard tools researchers use to answer these questions.

In this class, GitHub is infrastructure, not the main topic. You are not expected to become a Git expert.

The goal of this route is simply to help you:

  • feel comfortable working inside a repository
  • understand where code comes from and where it goes
  • build a mental model you can reuse in later projects

By the end of this route, you should be able to:

  • create a repository
  • clone it into Colab
  • make and commit changes
  • push and pull updates

Think of this as building muscle memory, not memorizing commands.

Instructions

Dataset / Repository

In this route, you will work with a GitHub repository that you create yourself.

Instead of starting from a pre-existing repository, you will:

  • create a new, empty repository on GitHub
  • add a small number of files (e.g., a README and a simple code file or notebook)
  • use this repository throughout the route to practice core Git workflows

This mirrors how most real ML and research projects begin: with a blank repository that gradually fills with code, notes, and experiments.

In the next exercise, you will create your own GitHub repository and clone it into Colab.

Environment: How we will use the command line

We will use Google Colab as our environment and run Git commands using Colab’s built-in Terminal. Where is the Terminal?

  • Look in the bottom-left corner of the Colab interface
  • Click Terminal
  • A terminal window will open that behaves like a standard Linux terminal

This terminal:

  • Remembers your current directory
  • Behaves like a terminal on your laptop
  • Is the interface Git is designed to work with

ℹ️ Colab Pro is free for students and PIs, but you probably do not need Pro for this route.

Exercise 1. Clone your repository into Colab

Goal: Create a local copy of your GitHub repository inside your Colab environment so you can work on it from the command line.

At this point, you have already:

  • created a GitHub repository under your account
  • edited README.md directly on GitHub
  • created at least one commit

Now you will bring that repository into Colab.

Step 1: Copy your repository’s URL

On your repository’s GitHub page:

  • click the green Code button
  • make sure HTTPS is selected
  • copy the repository URL

You do not need SSH for this route.

Step 2: Open the Colab Terminal

In Colab:

  • look in the bottom-left corner
  • click Terminal
  • a terminal window will open

This terminal behaves like a normal Linux terminal and is where Git commands are run.

Step 3: Clone the repository

In the Colab Terminal:

  • clone your repository using the URL you copied

If you’re unsure what command to use, you can ask the built-in Gemini assistant something like: “How do I clone my GitHub repository using git?”

Step 4: Verify the clone

After cloning:

  • a new folder with your repository’s name should appear
  • you can confirm this by listing files in the terminal or by opening the Files panel in Colab and navigating into the folder

This folder is your local copy of the repository.

Why this step matters

You now have:

  • a copy of your project on GitHub (remote)
  • a copy of the same project in Colab (local)

Most Git workflows involve moving changes between these two places. In the next exercise, you’ll start making changes locally and tracking them with Git.

Exercise 2. Make a local change and commit it

Goal → Create a new file inside your local GitHub repository, modify it using a Colab code cell, and record the change using Git.

At this point, you should have your repository cloned into Colab and be able to see the repository folder in the Colab file browser.

Create a new file inside the repository → Git only tracks files that live inside the repository folder. If you create a file elsewhere, Git will not see it.

Using a new Python code cell in Colab, create a text file called notes.txt inside your repository folder and write at least one line of text to it. Make sure you include the repository folder name in the file path so the file is created in the correct location.

You may:

  • write the code yourself, or
  • ask the built-in Gemini assistant for help

For example, you might ask: “How do I create a text file inside a specific folder using Python?”

After running the cell, confirm in the Colab file browser that notes.txt appears inside your repository folder, not at the top level.

Check repository status In the Colab Terminal, run the Git command that shows the current status of the repository. This tells you which files Git sees as new or modified and what it expects you to do next. If you’re unsure which command to use, ask Gemini.

Stage and commit the change Use Git to stage notes.txt and create a commit with a short message describing what you added. You may ask Gemini for help with individual commands if needed. [ADD COMMENT that they should do this in terminal → ]

Question What does git status show before staging, after staging, and after committing? Write 1–2 sentences describing how the output changes.

Why this matters You just completed the core Git workflow: create/edit → stage → commit. This loop is central to almost everything you’ll do with Git. In the next exercise, you’ll send this commit back to GitHub.

Exercise 3. Push your work

Push your commit to GitHub:

git push

  • Refresh the GitHub page to confirm the change appears.
  • Bonus: Create a new branch and push it.

Exercise 4. Pull new changes

  • On GitHub, edit notes.txt directly in the browser (e.g., add “Edited from GitHub interface.”).

On your machine, run:

git pull

  • Question: What happened? Where do the browser edits appear?

Exercise 5. Ask & answer a question about Git

Examples:

  • “How can I view a list of commits?”
  • “How do I switch branches?”
  • “What command shows file differences?”

Write the question in the notebook, answer it using Git commands in a code cell, and briefly reflect on what you learned.

Deliverables

1. Generate your deliverable file:

In a terminal or code cell, run these commands from your repository folder:

git remote -v > lastname_firstname_RID_007_deliverable.txt
git log >> lastname_firstname_RID_007_deliverable.txt

Verify the content:

cat lastname_firstname_RID_007_deliverable.txt

Your lastname_firstname_RID_007_deliverable.txt file should contain:

  • Your remote URL (fetch and push)
  • Your commit history showing the work you did

2. Logbook entry (plain text, ~5-10 sentences):

  • What was tricky or confusing
  • What helped you get unstuck
  • One thing you learned about Git workflows
  • File naming: lastname_firstname_RID_007_logbook.txt

Submission

Submit your files by uploading them to this submission link: SUBMIT LINK

Please upload both:

  • your lastname_firstname_RID_007_deliverable.txt file
  • your lastname_firstname_RID_007_logbook.txt file

Note: You do NOT need to submit a .ipynb notebook for this route. The deliverable.txt file with your git log output is what we need to verify your work.

Make sure filenames follow the naming conventions above.

🎉 Route Complete!

Great work!