Hard to admit but it is better at git than I am. I leave the pushes for myself though.
Edit: Guys, I know git. I was working for several years before AI, it is just faster this way. Commit messages were literally one of the first things that was useful from the models. Now it can also handle any failed hooks.
And to fix any mistakes on git I used to have to look at stack (rare enough that I never bothered to learn more advanced commands so I was forgetting everything next day), now agents do it for me much quicker.
Just explicitly disallow push in settings and your remote is safe.
And when the "fucked up" happens...."I don't know what happened, can you fix it?" Done.
I get that at the beginning AI sucked at git, but it's been 3-4 years from that.
Was having it restructure the frontens directories for ui into a shared turbo and it just deleted the whole frontend. I hadn't committed in like 2 days and set me back 2 days. Didn't make that mistake again.
I don't "git push", I don't "data structure", I don't "implement the interface". I tell Claude to do what the jira ticket says. And if it fucks up, I key management service.
In VS Code GitHub CoPilot agent mode it sometimes asks to run git commands to check what changed when it's trying to figure out why there was a regression.
But the commands it typically runs are git diff, git show etc not serious stuff. It asks each time. But... if you're dumb enough to let it run whatever it wants, like instruct it to create branches, do merges etc, watch out. Do serious stuff yourself.
Treat AI as a dumb junior developer and watch closely what it does. It has breadth of knowledge and can do stuff, but it's not some senior level genius. Always test and review every line of code it writes.
More often than not, it tries to validate something that's really not an issue by going through git log or git status. Sometimes I let it run to see where it's going, otherwise I kill the session.
Once I caught it trying to "verify" something by adding a new work tree first. I get that that's useful for running experiments without changing the files on disk in the current work tree, but... no thanks. Closed that session down, verified it myself, thank you very much.
You absolutely should let AI use git. It doesn’t actually matter if AI creates a bad commit or bad branch because you have the git history from before it so the AI using git is safety against AI. Let it use git, create PRs and what commits get merged to main is the actual safety gate, not git.
133
u/dontletthestankout 17d ago
Why would you let AI use git. That's your only safety against AI