Course contents

Git: What It Does, and What to Say

You will never type a git command. Claude runs all of them, and asks your permission first. This page exists so you know what you're approving when a permission prompt mentions one of these, the terms are worth knowing even though the typing isn't yours to do.

The daily six

What you want Say this to Claude The technical name, if you're curious
See what's changed since the last snapshot "what's changed?" git status
See the actual changes, line by line "show me the diff" git diff
Save a snapshot, labelled "commit this with a sensible message" git commit
See your snapshot history "show the recent commits" git log
Undo changes back to the last snapshot "throw away these changes" git checkout
Send your snapshots to GitHub (updates the live site) "push it" git push

Notice the pattern: you describe the outcome you want, in plain English. Claude picks the command, shows you what it's about to run, and you say yes. That's true of every row above and everything below it.

The recovery ladder (calmest first)

When something's gone wrong, say the plainest thing that describes what you want. Start at the top and only go further down if it wasn't enough:

  1. "Undo that." Claude reverts its own last change.
  2. Press Esc twice. Claude Code's own rewind, restores the conversation and the files to an earlier checkpoint. Not git; a Claude Code feature, and the fastest option when it applies.
  3. "Throw away these changes." Existing files go back to the last snapshot. Caveat: brand-new files Claude created stay put, if you want those gone too, say "throw away all changes, including new files." (Behind the scenes: git checkout for existing files, git clean for new ones.)
  4. "Go back to [an earlier commit], show me the list first." Rewinds the whole project to any snapshot ever taken. Feels like it destroys everything after that point; ask Claude to talk you through it the first time, though even this is recoverable for weeks afterward, because commits are very hard to truly lose. (git reset --hard)
  5. "Something's really wrong, can you get a fresh copy of my project from GitHub?" If the project's state is beyond understanding, Claude downloads your own repo again into a new folder. GitHub has everything you ever pushed. (This is why you push.) (git clone)

Three facts that explain everything

Words you'll hear