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
| Git | GitHub |
|---|---|
| Tool on your computer | Cloud storage & sharing |
| Tracks changes locally | Stores code online |
| Like Microsoft Word | Like Google Drive |
Git is the version control tool. GitHub is where you store and share your code online.
Key Terminology
| Term | Meaning |
|---|---|
| Repository (repo) | A project folder tracked by Git |
| Commit | A saved snapshot at a point in time |
| Push | Upload your commits to GitHub |
| Pull | Download 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:
- Select GitHub.com
- Select HTTPS
- Select Login with a web browser
- Copy the one-time code
- Complete authentication in your browser
Pushing to GitHub
Tell Claude:
Create a GitHub repository and push this project
Claude will:
- Create a new private repository on GitHub
- Connect your local project to it
- 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.