Git basics for vibe coders
The five git concepts that save vibe-coded projects: commits as save points, why to commit before every big AI change, and how to undo disasters.
8 min read · Last verified
Here's the scenario git exists to prevent: your app works, you ask the AI for "one small change," and twenty minutes later everything is broken and neither of you can remember how to get back. Without git, that project is gone. With git, it's a thirty-second fix.
Git is a save-point system for code. Professional developers use maybe 5% of what it can do, and you need about half of that. This guide is that half.
The five concepts
Repository (repo). A folder that git is watching. One project = one repo.
Commit. A save point — a named snapshot of every file in the project at one moment. Commits are permanent: you can always get back to any commit, no matter what happens after it. This is the entire magic.
Message. Every commit gets a one-line description ("Add scoreboard", "Fix mobile layout"). Future-you, scrolling history at midnight, depends on these.
Push. Copy your commits to a hosted backup (GitHub, usually). Your laptop can now fall in a lake.
Branch. A parallel line of save points for experiments. Genuinely
useful, but skippable until you feel the need — solo vibe coders can live
on main for a long time happily.
The one habit that matters
Commit before every significant AI change. That's the whole religion. Working app → commit → then "redesign the whole layout." If the AI nails it, commit again. If it destroys everything, you roll back and lose nothing.
AI agents are the reason this habit matters more for vibe coders than for traditional programmers: an agent can modify fifteen files in one go. Undo-in-the-editor doesn't cover that. Commits do.
The nice part: you don't have to learn commands if you don't want to. All the big AI coding tools speak git. Say "commit what we have with a sensible message" before big changes, and "commit and push" at the end of a session. Many app builders (Lovable, Bolt, Replit) also keep history automatically and let you sync to GitHub — find that feature and turn it on.
The commands, if you want them
Typing them is faster than asking eventually. This is 90% of daily git:
git init # start watching this folder (once per project)
git add -A # stage everything that changed
git commit -m "Add scoreboard" # save point
git log --oneline # list your save points
git push # back up to GitHub
When disaster strikes
First, see the damage and the history:
git status # what's changed since the last commit
git log --oneline # recent commits, newest first
Mess isn't committed yet? This throws away all uncommitted changes and returns you to your last save point:
git checkout .
Mess was committed? This makes a new commit that undoes a bad one — history stays intact, nothing is lost:
git revert <commit-id>
Or honestly: tell your AI agent "the app worked two commits ago, get us back to that state." Reciting exact commands under stress is what the agent is for — the concept you need is simply the good version still exists.
One warning: commands containing reset --hard or --force permanently
destroy work. If the AI proposes one, ask it to explain what will be lost
before you say yes.
Why this unlocks everything else
GitHub isn't just backup. It's how you deploy to Vercel or Netlify, how you move a project from an app builder to pro tools, how you'd ever let a collaborator in, and how you prove the build journey behind anything you submit to the gallery. Every serious path out of the sandbox runs through a repo — which is why this is the first Level Up guide.