What is your git workflow when letting AI edit your codebase?

by•

Last week I let an AI coding tool make a few big updates back-to-back without committing anything in between. The last edit broke a working part of my app, and sorting through the changes took me hours.

Since then I treat git commits like a save button in a video game and commit after almost every good prompt.

How do you handle version control with AI tools? Do you commit constantly or rely on your code editor's undo history?

20 views

Add a comment

Replies

Best

each agent works in its own worktree, and I stage files by name instead of commit -a. when two sessions share a folder that saves you from some very weird commits

i commit after something actually runs, not after every prompt. undo only helps until you touch another file, so i do not trust it for big agent passes.

My agents can commit, but only when I ask them to, and a few git commands are simply off limits. Force pushes and git clean never run, and hard resets only run when I say so. Those are in the global rules every session reads, and the riskiest ones are blocked by a hook too.