Abie Maxey
BuildingApril 9, 20266 min read

Why git Matters When You Build with AI

AI can write your code. But if it only lives on localhost, you haven't shipped anything.

terminal ~ abiemaxey

$ git push origin main

ERROR: Build failed ~ Expected '</', got 'ident'

$ # cool. cool cool cool.

đź’€

All Posts

So I was shipping features all morning. New dropdown, services overhaul, project scope wizard ~ the works. Pushed to main. Vercel picks it up. Build fails. Site goes down. Not because the code was bad ~ because a squash merge turned my Header into a Frankenstein. Half new code, half old code, one very confused JSX parser.

5-minute fix. Felt like 5 hours. And it was completely preventable if I'd just followed my own rules. So here they are ~ the git stuff I actually use, written down so I stop learning the same lesson twice.

The Annoying Part ~ it's never the code

Building with AI is fast. Like, annoyingly fast. Claude Code reads my codebase, writes the feature, runs the type check. I review it, tweak it, ship it. The code part is the easy part now.

The annoying part is everything else. Deploys breaking because of a merge gone wrong. Files you didn't touch suddenly broken. Two branches editing the same component and neither knows the other exists. That's the stuff that eats your afternoon.

And here's the thing ~ none of that is an AI problem. It's a git problem. Or more specifically, a “you didn't use git properly” problem. Which is me. I'm the problem.

vercel ~ actual build output from today

ERRORTurbopack build failed with 1 error

222 | </div>

223 | </div>

>224 | <p className="font-serif...">

^^^^^^^^^

Expected '</', got 'ident'

// a <p> tag floating outside its parent <Link>.

// courtesy of a squash merge that mixed two versions.

With Git ~ vs without

I know people who build full apps with AI and then email the folder to themselves as a backup. I'm not judging. I'm just saying there's a reason my site is live and theirs is on a USB drive somewhere.

With git vs without git

AI writes a feature

Commit it, review the diff, push when ready

Hope you remember what changed

Deploy breaks

Revert to last working commit in seconds

Panic. Ctrl+Z. Pray.

AI generates bad code

git checkout -- file.tsx ~ gone

Manually undo 47 changes across 12 files

Two features at once

Separate branches, merge when ready

Everything in one folder. Good luck.

The Flow ~ I actually use

Nothing fancy. I do this every day and it takes maybe 30 extra seconds compared to pushing straight to main. Those 30 seconds have saved me from breaking production more times than I can count.

Branch
Code
Commit
Push
PR
Merge
the actual commands

$git checkout -b feat/new-tools-dropdown

Switched to a new branch 'feat/new-tools-dropdown'

$# ... claude writes the code, I review ...

$git add src/components/sections/Header.tsx

$git commit -m 'feat: grouped Tools dropdown by category'

$git push origin feat/new-tools-dropdown

$gh pr create --title 'feat: premium Tools dropdown'

https://github.com/you/repo/pull/55

// review the PR. click merge. done.

Branch. Code. Commit. Push. PR. Merge. Every time. Even when I'm the only person on the team. Especially when I'm the only person on the team.

Commit Messages ~ + branch protection

Two things that take zero effort and save you constantly.

Commit messages: prefix with what you did. feat: for new stuff. fix: for bugs. style: for visual tweaks. Three months from now when something breaks, you'll scroll through git log and actually find it. “updated stuff” won't help you. Trust me.

good vs bad

feat:add grouped Tools dropdown by category

fix:Header JSX parse error on Vercel build

style:reduce mobile nav padding

"fixed stuff" // no

"update" // absolutely not

"asdfasdf" // I've done this. I'm not proud.

Branch protection: go to GitHub Settings → Branches → add a rule for main → “Require pull request before merging.” Now nobody can push to main directly. Including you. Including you at 2am when you think “it's just a small change.”

Seriously, set this up

GitHub → Settings → Branches → Add rule → “main” → Require pull request before merging. Takes 30 seconds. Saves you from yourself.

What I Let AI Handle ~ and what I don't

I have a shortcut with Claude Code. When I'm done building, I say “done baby” and it stages the files, writes the commit message, pushes to the branch, creates a PR with a summary, and gives me the URL. That part is automated. I don't need to type git commands every time.

But I still review the PR myself. Every time. Because AI is fast, not careful. It wrote the code ~ of course it thinks it's great. I'm the one who catches the weird stuff. A component that shouldn't be there. A file that got changed but shouldn't have been. A merge that looks clean in the terminal but isn't.

The split is: AI does the ceremony. I do the judgment. That's it. That's the whole system.

The Cheat Sheet ~ pin this somewhere

git commands you'll actually use

# start a new feature

$git checkout -b feat/my-feature

# see what changed

$git status

$git diff

# save your work

$git add src/components/Header.tsx

$git commit -m 'feat: add mobile nav'

# push and create PR

$git push origin feat/my-feature

$gh pr create --title 'feat: mobile nav'

# undo mistakes

$git checkout -- file.tsx # discard one file

$git stash # shelve everything

$git log --oneline -10 # recent history

That's genuinely all I use. Every day. For three businesses and a personal brand. Git isn't complicated ~ it's just not optional anymore. Especially when you're building fast with AI and your deploy pipeline is one bad merge away from taking your whole site down.

Ask me how I know.

Free Playbook

Master Claude

15 lessons. From first prompt to production agent. Git workflows, CLAUDE.md, deployment ~ all of it.

Abie Maxey

Love,

Abie

Weekly Dispatch

The builder's diaries.

What I'm building, breaking, and figuring out.

  • AI tools I actually use to build faster
  • Behind-the-scenes of growing a business in Madrid
  • Community plays, client wins, and real revenue breakdowns
  • Grounded dispatches from someone building roots

Growing Community

Drop your email.

Unsubscribe any time. No spam, ever.