Course Home / Module 2: Vibe Coding

2.4: GitHub

15 min
Interactive: start 2-4

What is Version Control?

Version control is a system that tracks every change to your files over time.

Think of it like “track changes” in Word, but for your entire project. It lets you:

  • See history – What changed and when
  • Restore versions – Go back if something breaks
  • Undo mistakes – Reverse changes that didn’t work

Git vs. GitHub

GitGitHub
Tool on your computerCloud storage & sharing
Tracks changes locallyStores code online
Like Microsoft WordLike Google Drive

Git is the version control tool. GitHub is where you store and share your code online.


Key Terminology

TermMeaning
Repository (repo)A project folder tracked by Git
CommitA saved snapshot at a point in time
PushUpload your commits to GitHub
PullDownload GitHub changes to your computer

Why GitHub Matters for Deployment

Code must exist on GitHub because deployment services pull directly from it.

When you deploy to Vercel (next lesson), Vercel reads your code from GitHub. Local-only code can’t be deployed.

Your Computer → GitHub → Vercel → Live Website

The GitHub CLI

The GitHub CLI (gh) lets you interact with GitHub from the terminal. No need to use the website or remember Git commands—Claude handles it.


Setting Up GitHub

Step 1: Create a GitHub account

If you don’t have one, sign up at github.com.

Step 2: Install GitHub CLI

Mac:

brew install gh

Windows:

winget install GitHub.cli

Linux:

sudo apt install gh

Step 3: Authenticate

gh auth login

Follow the prompts:

  1. Select GitHub.com
  2. Select HTTPS
  3. Select Login with a web browser
  4. Copy the one-time code
  5. Complete authentication in your browser

Pushing to GitHub

Tell Claude:

Create a GitHub repository and push this project

Claude will:

  1. Create a new private repository on GitHub
  2. Connect your local project to it
  3. Push all your code

Making Changes

After pushing initially, future updates are simple:

Save my changes to GitHub

Claude creates a commit with your changes and pushes them.


Troubleshooting

”gh: command not found”

The GitHub CLI isn’t installed.

Fix:

  • Mac: brew install gh
  • Windows: winget install GitHub.cli
  • Or visit cli.github.com

”Authentication failed”

Your login expired or wasn’t completed.

Fix: Run gh auth login again and complete the browser authorization.


”Repository already exists”

You’re trying to create a repo with a name that already exists.

Fix: Either:

  • Choose a different name
  • Delete the existing repo on github.com

”Permission denied”

Your authentication token expired.

Fix: Re-authenticate with gh auth login.


”Repository not visible”

Fix: Make sure you’re logged into the correct GitHub account in your browser.


Best Practices

  • Commit frequently – Small, focused commits are easier to understand
  • Write descriptive messages – “Fix quiz scoring bug” not “Update”
  • Keep repos private until ready to share
  • Don’t commit secrets – API keys, passwords, etc.

What’s Next

Your code is now backed up on GitHub. In the next lesson, you’ll deploy it to the web so anyone can access it.


Ready to save your work? Run start 2-4 to push your project to GitHub.