Letting the AI drive (while you stay in charge)
Here's the freeing part: you do not have to memorize any of these commands. You can tell the AI "commit this with a sensible message" or "create a branch for the new feature and switch to it," and it'll run the right commands. That's a perfectly good way to work.
The catch — and it's the same catch as the rest of this book — is that you stay responsible for understanding what it did, even if you didn't type it. The middle path that actually works:
- Let the AI run the commands, but ask it to tell you what each one does in plain English the first few times.
- Read the diff yourself before any commit. This is non-negotiable. It's how you catch the AI deleting something it shouldn't.
- Commit often, in small pieces. Lots of small save points beat one giant one, because rewinding is precise instead of all-or-nothing.
- Branch before anything big. Tell the AI to make a branch before a major rewrite, so
mainstays safe. - When a command sounds destructive (anything with
reset --hard, force-push, or deleting branches), ask "what exactly does this do?" before approving it.
You're the tech lead. The AI is your fast, capable, occasionally reckless teammate. Git is the process that keeps that teammate from doing real damage. Learn it well enough to direct it confidently, and you'll never fear the "rewrite everything" button again — because you'll always have a way back.