Menu

Post image 1
Post image 2
1 / 2
0

Stop Trusting AI Agents with Git — Start Governing Them

DEV Community·Hector Flores·19 days ago
#vxzJCOkZ
Reading 0:00
15s threshold

The 2 AM Disaster You Don't See Coming I run AI agents as my primary development interface — not just for code generation, but for the entire lifecycle : branching, committing, pushing, PR creation, deployment. I use git worktrees extensively for parallel work streams, which means the surface area for agent mistakes is enormous. And agents make mistakes. Not maliciously. Not because they're broken. Because they're non-deterministic . You tell an agent to "commit and push this change," and most of the time it does exactly what you'd expect. But often enough to matter? It creates a branch off HEAD~3 instead of main . It pushes to the wrong remote. It runs git add . in the repo root instead of the worktree. It stages your .env file. It invents a merge strategy you didn't ask for. The standard advice is to write better instructions. Put your git workflow in copilot-instructions.md . Be more specific. I tried all of that. It's insufficient. Instructions are suggestions. Agents follow them until they don't.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More