💡 What version control actually is
Imagine you're working on a document and you could save a named snapshot at any point — not just "last saved", but "this was the working version before I tried something risky." And you could go back to any of those snapshots instantly, without losing anything in between. That's version control.
Git is version control for code (and anything text-based). GitHub is a website that stores your Git history online, so it's backed up, shareable, and accessible from any machine.
Why this matters for vibe coders specifically: When you're building with AI, the AI will sometimes break something that was working. Without Git, your only option is undo. With Git, you have named checkpoints you can return to exactly — even days or weeks later.
.git folder that stores the history.🖥️ Two ways to use Git
You can use Git from the terminal (command line) or via GitHub Desktop — a free visual app that does the same things with buttons instead of commands. Both are valid.
Terminal Git — the commands you actually need:
$ git init
# Stage everything for a commit
$ git add .
# Save a snapshot with a message
$ git commit -m "Add homepage layout"
# See what's changed since last commit
$ git status
# See the list of commits
$ git log --oneline
# Go back to a previous commit (safely)
$ git checkout abc1234
GitHub Desktop — download from desktop.github.com. It shows all your changes visually, lets you write commit messages, and handles push/pull with buttons. If the terminal feels like too much, start here.
The one habit that matters most: Commit every time something works. Not at the end of the day — when it works. "Got the navigation working" is a good commit. "Three hours of changes" is a bad commit. Small, frequent, named checkpoints are the whole point.
🐙 Pushing to GitHub
Once your project is committed locally, you can push it to GitHub to back it up and share it.
$ git remote add origin https://github.com/yourusername/your-repo.git
# Push (upload) your commits
$ git push -u origin main
After the first push, future pushes are just git push. Your project is now backed up online.
🌐 GitHub Pages — free hosting for your project
If your project is a website (HTML, CSS, JS — which it is if you built it with an agentic IDE), GitHub Pages will host it for free with a public URL. No servers, no hosting fees.
main) and the folder (usually / (root) if your index.html is at the top level). Click Save.yourusername.github.io/your-repo-name. Every time you push, it redeploys.What this means practically: You build something in a session, push it to GitHub, set up Pages — and now you have a real URL you can share with anyone. Your surf school booking page, your art portfolio, your event landing page. Live, free, takes 10 minutes to set up.
🛡️ .gitignore — what never to commit
A .gitignore file tells Git which files to never track. This is non-negotiable: some files must never appear in your commit history.
What to always ignore:
.env files containing API keys or passwords. node_modules/ (can always be regenerated). .DS_Store (Mac folder metadata). Any file ending in .pem, .key, or secret.
If you accidentally commit an API key, it is compromised — even if you delete it in the next commit. Someone may have already copied it from GitHub. Always revoke and regenerate any key that touches a public repo.
.env
.env.local
.env.*.local
# Dependencies — install from package.json instead
node_modules/
# Mac/OS metadata
.DS_Store
# Build output — generate, don't commit
dist/
build/
Ask Claude to write your .gitignore: "Write a .gitignore file for a [Node.js / Python / HTML] project that uses [whatever tools you have]. Include any common sensitive files." It takes 10 seconds and gets it right.
🤖 AI decodes Git errors
Git error messages are notoriously cryptic. The good news: AI is excellent at diagnosing them. If Git gives you an error you don't understand — paste it directly into Claude or Gemini with the message "I got this Git error, what does it mean and how do I fix it?"
Here are the most common Git errors and what they actually mean:
<<<<<<< markers. Choose which version to keep and delete the markers.git pull first to get those commits, then try pushing again.git checkout main (or git switch main) to get back to safety.Copy the full error message from your terminal. Open Claude.ai or Gemini. Paste with context:
"I'm learning Git and got this error when I tried to push my project to GitHub: [paste error]. I'm using [Mac/Windows]. What does this mean and what should I type to fix it?"
Nine times out of ten, this gives you a clear, step-by-step fix. Git errors feel scary but they're almost always recoverable — especially if you haven't lost any committed work.
👇 Push your Module 5/6 build
Take the project you built in Module 5 or 6 and put it online.
- Open the project folder in your terminal (or use GitHub Desktop)
- Run
git initif you haven't already — or it may already be initialised by your IDE - Run
git add .thengit commit -m "Initial project build" - Create a new repo on github.com and push using the commands GitHub gives you
- Go to Settings → Pages → deploy from
mainbranch - Share the URL with someone
If you hit errors: paste the error message into Claude or Gemini and ask what to do. This is exactly the kind of problem AI is good at diagnosing.
Branch complete 🌿
Git is not a developer tool — it's a professional habit. Once it's automatic, you'll never again lose a working version to an AI that broke something.