Use Git before you let AI touch your code
An AI agent can change fifty files in a minute. Most of the time that's the magic. Sometimes it rewrites something that was working, and you don't notice until tomorrow.
If your code isn't in source control, there's no going back. If it is, going back takes seconds.
What Git is
Git is source control. It keeps a history of every change to your files, who made it and why. You can compare any two versions, see exactly what changed and roll back to any point.
It was built in 2005 by the Linux community, led by Linus Torvalds, to manage one of the biggest software projects in the world. Today it's the standard almost everywhere. It's free, and services like GitHub keep a copy of your history off your machine.
If you're building anything with AI, set it up before your first session. Not after the first disaster.
The habits that matter
Commit before every session. Save a clean point before the AI starts. If the session goes sideways, you go back to it.
One branch per job. Each task gets its own branch. The AI works there, and your main version stays untouched until you've checked the work.
Read the diff. Before you accept anything, look at what actually changed. AI is good at fixing the thing you asked about and quietly changing three things you didn't.
Small commits. One change, one commit, with a plain message. When something breaks next week, you'll find it in minutes.
Push to a private remote. Keep a copy on GitHub or similar. A laptop is one spilled coffee from losing everything.
Walls for the AI
No rewriting history. Don't let an agent force push or rewrite past commits. That's the one move that can erase your undo button.
Secrets never go in. Passwords and API keys stay out of Git, listed in an ignore file. And never let an agent add "everything" in a folder that has secrets in it. Add files by name.
A person merges. The AI can open the change. A person reads it and merges it to main.
Git is the undo button. Set it up before you need it.
For more walls like these, read AI guardrails: real examples.
Sources: Pro Git, "A Short History of Git".
Get each new post by email.
One email when a post is out. Unsubscribe anytime.