Git Setup
What version control is, how to install Git, the commands you'll actually use, and how to connect to GitHub.
Before you start
Your IDE should be set up (IDE Setup guide). You'll need the terminal inside your IDE.
What is version control?
Version control is a system that tracks every change you make to your project and lets you go back to any previous version at any time.
Think of it like the version history in Google Docs. You write something, and Google saves a snapshot. You change it, and Google saves another snapshot. If you mess something up, you scroll back through the history and restore an earlier version. Nothing is ever truly lost.
Git does the same thing for your entire project — every file, every folder. But unlike Google Docs, Git doesn't save automatically. You decide when to take a snapshot. This gives you control over what gets saved and when, which matters a lot when you're building software.
Why vibe coders need Git
Undo mistakes. You asked AI to make a change and it broke everything? Roll back to the version before the change. Instantly.
Experiment safely. Want to try a risky change? Create a branch (a parallel copy of your project), try the change there, and if it doesn't work, delete the branch. Your original code is untouched.
Back up your work. When you push your code to GitHub (more on that below), it's stored in the cloud. Your laptop could catch fire and your code would still be safe.
Track what changed. When something breaks, Git can show you exactly what changed since the last time things were working. This makes debugging dramatically easier.
Install Git
Mac
Git might already be installed. Open your terminal and type:
git --version
If you see a version number, you're done. If you get a prompt to install command line developer tools, click Install and follow the steps. This installs Git along with some other useful tools.
Windows
Go to git-scm.com and download the Windows installer. Run it. The default options are fine for everything — just click Next through the installer.
After installation, open a new terminal in Cursor and verify:
git --version
Linux
sudo apt update && sudo apt install git
sudo dnf install git
Configure Git
After installing, tell Git who you are. This information gets attached to your snapshots so you can see who made each change (important when you collaborate with others, and useful for tracking your own work).
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
Use the same email you'll use for GitHub (we'll set that up next).
The commands you'll actually use
Git has dozens of commands. You need about seven. Here they are, in the order you'll use them.
git init
Turns a regular folder into a Git project. You run this once when starting a new project.
git init
git status
Shows you what's changed since your last snapshot. Files you've modified, new files you've added, files you've deleted. This is your "what's going on right now" command.
git status
git add
Stages files for your next snapshot. Think of it like putting items in a box before sealing it. You're telling Git "include these changes in the next snapshot."
git add .
The dot means "everything that's changed." You can also add specific files: git add filename.js.
git commit
Takes the snapshot. This saves all the staged changes with a message describing what you did.
git commit -m "Add login page"
The message in quotes should be short and describe what changed. Good messages: "Add user signup form," "Fix broken navigation," "Update homepage layout." Bad messages: "stuff," "changes," "asdfasdf."
git log
Shows your history of snapshots. Useful for seeing what you've done and finding a point to go back to.
git log --oneline
The --oneline flag shows each commit on a single line so it's easier to scan. Press q to exit the log view.
git push
Uploads your snapshots to GitHub (or another remote host). This is how you back up your work and share it.
git push
git pull
Downloads the latest changes from GitHub. Use this if you (or someone else) made changes from another computer.
git pull
Connect to GitHub
Git lives on your computer. GitHub is a website that stores your Git projects in the cloud. Think of Git as the save system and GitHub as the cloud storage where your saves get backed up.
Create a GitHub account
Go to github.com and sign up. The free account is all you need.
Create a new repository
On GitHub, click the + in the top right and select "New repository." Give it a name (usually your project name), keep it private (you can change this later), and click "Create repository."
GitHub will show you a page with setup commands. You'll need the URL it gives you — it looks like https://github.com/yourusername/your-project.git.
Connect your local project
In your terminal (inside your project folder), run:
git remote add origin https://github.com/yourusername/your-project.git
git push -u origin main
The first command tells Git where your GitHub repository is. The second uploads your commits. You'll only need to do this setup once per project. After that, git push is all you need.
The workflow
Here's the full flow you'll follow for every project:
Start: Create a project folder, run git init, connect to GitHub.
Work: Make changes (or have AI make changes). Periodically run git add . then git commit -m "what I did".
Back up: Run git push to upload to GitHub.
Repeat.
How often should you commit? A good rule of thumb: commit after every meaningful change. Finished a feature? Commit. Fixed a bug? Commit. About to try something risky? Commit first, so you can roll back if it breaks.
Git is set up. 📸
You've got version control, you know the core commands, and your code is backed up on GitHub. Last guide: an overview of the AI coding tools you can use to actually build things. AI Tools Overview →
Stay in the loop.
New guides, book updates, and courses — we'll let you know.
No spam. Just the good stuff.