Module 5: Git & GitHub
Lesson 1

Why Git? The Save-Point Analogy Explained


The Problem

Picture this. You're building your app and it's working beautifully. You decide to add one more feature. Three hours later, something breaks — and you have no idea what you changed or how to undo it.

Or: your laptop dies. Everything you built is gone.

Or: you want to try a big redesign, but you're not sure it'll work, and you're terrified of ruining what you already have.

Git solves all three of these. And the good news for non-coders: Claude Code can run Git for you. Your job isn't to memorize commands — it's to understand what Git is doing so you can ask for the right thing and trust the result.


What Is Git?

Git is a version control system — software that quietly tracks every change you make to your project over time.

Think of it as a detailed "save history" for your entire app. Not just one save you keep overwriting, but a full record of every snapshot you've ever taken: when you took it, and exactly what changed since the last one.

With Git you can:

  • Go back to any previous version of your app
  • See exactly what changed between any two points in time
  • Work on new features without putting your stable version at risk
  • Collaborate with others without overwriting each other's work
  • Understand why a change was made, thanks to the note you leave with each save

The Key Analogy: Save Points in a Video Game

If you've ever played a video game with save points, you already understand the heart of Git.

  • Saving your game = making a commit in Git
  • Multiple save slots = multiple branches in Git
  • Loading an earlier save = checking out an older commit

There's one bonus that games don't give you: every Git "save" also records what changed since the last one. So you don't just see what your app looks like now — you can replay the history of every decision that got you here.


Git vs. GitHub — What's the Difference?

This trips up almost everyone at first, so let's settle it now.

GitGitHub
What it isSoftware on your computerA website
What it doesTracks changes on your machineStores your code in the cloud
Who made itLinus Torvalds (2005)Microsoft
Works without the other?YesNo (it needs Git)

Git is the tool. It runs locally, on your computer.

GitHub is a hosting service — a website where you upload (push) your Git project so it's backed up safely and reachable from anywhere.

There are alternatives to GitHub (GitLab, Bitbucket), but GitHub is by far the most widely used, and it connects directly to Vercel for deploying your app.


The Core Workflow

Git's workflow has three stages. You'll see this pattern everywhere, so it's worth understanding once.

Working Directory  →  Staging Area  →  Repository

  (make changes)   →   (git add)    →   (git commit)

1. Working Directory

This is your project folder — every file you create or edit lives here.

2. Staging Area

Before you save, you "stage" the files you want to include. This lets you be deliberate: you decide exactly what goes into each snapshot.

3. Repository

Once you commit, the snapshot is permanently recorded in your local repository — a hidden .git folder tucked inside your project.

From there, you can push to GitHub to sync with the cloud.


What's a Commit?

A commit is a snapshot of your project at one moment in time, plus a short message describing what changed.

Good commits are:

  • Focused — one logical change per commit (don't cram ten unrelated things into one)
  • Well described — the message should explain what changed, ideally hinting at why

Bad commit message: fixed stuff

Good commit message: Add task deletion with confirmation prompt

When you ask Claude Code to commit, it writes the message for you. You can review it and ask for a clearer one:

"Commit my changes with a clear message describing what we just added."


Branches: Working in Parallel

A branch is a parallel version of your code. You can:

  • Create a new branch for a new feature
  • Work on it freely without touching the main version
  • When it's ready, merge it back in

For this course you'll mostly stay on one branch, called main. But branches still matter to understand because:

  • Claude Code sometimes creates branches automatically for bigger changes
  • Vercel deploys your main branch by default
  • If you ever collaborate, branches are how you avoid stepping on each other

A Real Scenario

Here's how Git rescues you in real life:

"I spent two days building a feature. It works. Then I try to redesign the styling and break everything — and I can't figure out what I changed."

Without Git: you're stuck. The broken version is all you have.

With Git: you return to the commit from just before the redesign. Your app snaps back to that exact state in seconds. You start the redesign again, this time committing in small steps as you go.

This is why developers commit constantly. Small, frequent commits create a fine-grained safety net underneath everything you do.


Summary

  • Git is version control: a record of every change you've made, restorable at any point
  • Think of commits like save points in a video game — but each one also records what changed
  • Git is the tool on your computer; GitHub is the cloud service that stores it
  • The core workflow is: make changes → git addgit commit
  • Commits should be small and carry clear messages
  • Branches let you work on features without risking your stable code
  • Claude Code can run Git for you — your job is to understand what it's doing