~/VibeHandbook
$39

Chapter 01 · 02

Repositories, commits, and history

Three words you'll hear constantly. Let's demystify them.

A (or "repo") is just a folder that is watching. You turn an ordinary folder into a repo once, and from then on Git tracks everything inside it.

A is one save point. It's a snapshot of every file at a moment in time, plus a short message from you describing what changed ("added the login page", "fixed the broken signup button"). You make commits constantly — think of each as a checkpoint you might want to return to.

The history is the ordered list of all your commits. It's the timeline. You can scroll through it, read what each change was, and travel back to any point.

Here's how that looks in practice. Don't worry about memorizing it — you'll mostly have the AI run these for you — but read along so the words stop being mysterious:

# Turn the current folder into a Git repository (do this once)
git init

# See which files have changed since your last save point
git status

# Stage your changes, then save them as a commit with a message
git add .
git commit -m "Add the homepage layout"

# Look at your history — every commit, newest first
git log --oneline

git add . is you saying "include all my changes in the next save point." git commit is the actual save. The -m "..." is your note to your future self. Write notes you'd understand a month from now.

Those two commands move your work through three stages. A file you edit isn't saved until it has travelled all the way to the right:

   ┌─────────────────┐  git add   ┌─────────────────┐  git commit  ┌─────────────────┐
   │  WORKING DIR    │ ─────────▶ │     STAGING     │ ───────────▶ │     HISTORY     │
   │  files you edit │            │  changes picked │              │  saved commits  │
   │  (not saved yet)│            │  for next save  │              │  (safe forever) │
   └─────────────────┘            └─────────────────┘              └─────────────────┘
       you change             you choose what               it becomes a
        a file                goes in the commit            permanent snapshot

Want it offline?

Get the PDF + EPUB + downloadable prompt library + version updates.

$ Get the PDF — $39