promptgarden ๐ŸŒฑ
๐ŸŒ ES
Guideโ—โ—‹โ—‹5 min ยท +20 XP

Git & GitHub for Vibe Coders

Why agents keep talking about commits and branches - and how that knowledge saves you when one breaks something.

Why agents keep talking about commits

AI coding agents like Claude Code work directly inside your project and use Git to track changes. Without basic Git knowledge, you can't really follow what the agent is doing - or undo it if something goes wrong.

The 5 concepts you need

  • Repository (repo): the project folder plus its full change history
  • Commit: a snapshot of the project at one point in time, with a short description
  • Branch: a parallel copy of the project for trying out changes in isolation
  • Push: uploading your local commits to a server (e.g. GitHub)
  • Pull request (PR): a proposal to merge changes from one branch into another - someone can review it before it lands

How this saves you when an agent breaks something

Every commit is a save point. If an agent breaks something, you can go back to an earlier commit (checkout) or undo a single change (revert) - without rebuilding everything from scratch.

A minimal practical flow with an agent

Have the agent commit in small steps instead of bundling everything into one giant commit. After each meaningful step: look at the diff, review it, then continue. That keeps every mistake small and easy to undo.

EXAMPLE

Prompt to the agent: 'Commit separately after each working intermediate step, with a short description. I'll review each commit before you continue.'

QUICK QUIZ

What's the fastest way to undo a broken change an agent made?

SOURCES

RELATED TOPICS

Claude Code: Anthropic's CLI Agent โ—โ—โ—‹Vibe Coding: When It Works, When It Bites You โ—โ—‹โ—‹Guardrails for Autonomous Agents โ—โ—โ—