← The AI Builder Stack

Git, Environments & Deployment

The gap between "it runs on my laptop" and "a real person can use this" is entirely made of plumbing you're about to learn to supervise.

00 — Why This Layer Exists

Every builder hits the same moment: the AI agent says "done," the app runs beautifully in the preview window, and then... nothing. There's no link to send anyone. Your co-founder can't see it. Your beta tester can't touch it. That gap — between "it works when I click run" and "someone else can open a URL and use it" — is what this layer closes.

Three things stand between a demo and a real product: a record of what changed and when (version control), a place for that code to actually run where other people can reach it (deployment), and a way to test changes safely before they hit real users (environments). None of this is optional once more than one person — you and an AI agent count as two — is touching the project. You don't need to become an engineer to manage this. You need to understand what's happening well enough to supervise an AI agent that's doing the mechanical work, and to know which two or three moments demand your judgment instead of your trust.

01 — What Git Actually Tracks

Git is a version control system: software that keeps a complete history of every change ever made to your project's files. Think of it less like "undo" and more like a very disciplined save system that never overwrites the past — every saved snapshot stays retrievable forever.

A commit is one snapshot: a bundled set of file changes with a message describing what changed and why. A repository ("repo") is the whole project folder plus its entire commit history. A branch is a parallel, isolated line of work — a copy of the codebase where you (or your agent) can make changes without touching the version everyone else sees. The default branch, usually called main, is meant to represent the working, trustworthy version of your product.

As a non-coder, you will almost never type git commands yourself. Your AI coding agent (see Layer 03) runs git commit, git branch, and git push on your behalf. Your job is to understand what those words mean well enough to know when to say "stop, let me look at this first" — which is most of what the rest of this layer is about.

02 — Why "It Works on My Machine" Happens

You'll hear this phrase constantly, and it's not an excuse — it's a real, common failure mode. It happens because "your machine" (or your agent's sandbox) has a specific combination of software versions, installed packages, operating system quirks, and configuration files that a server somewhere else doesn't have. Code that depends on any of that silently breaks when it moves to a different environment.

The practical fix isn't glamorous: keep the list of dependencies (the external code libraries your project needs) written down in a file the project carries with it, rather than relying on whatever happens to already be installed locally. Modern AI agents typically handle this automatically by maintaining that dependency file as part of the project — but it's worth knowing this is why a deploy sometimes fails even though everything looked fine five minutes ago in your agent's chat window.

03 — Staging vs. Production, Explained Simply

You'll hear these two words used constantly once you start deploying. They describe where a version of your app lives and who it's for.

Staging Production
Who sees it You, your team, testers Real users/customers
Purpose Catch problems before they matter The actual live product
Data Fake or test data Real user data
Risk of breaking something Low — nobody's relying on it High — people are using it right now
On Vercel/Netlify, roughly maps to Preview deployments Production deployment

The rule of thumb: nothing goes straight from an AI agent's output to production. It goes to staging (or a preview link) first, gets looked at by a human, and only then gets promoted. Vercel's own documentation describes exactly this three-stage model — Local, Preview, and Production — as the default way projects are structured.

04 — Environment Variables and Secrets

An environment variable is a piece of configuration — often a password, API key, or database connection string — that your app needs to run, but that lives outside your code rather than typed directly into it. Instead of writing apiKey = "sk-abc123" in a file, you write apiKey = process.env.API_KEY and the actual value is set separately, in the hosting platform's dashboard.

This matters enormously for you as a non-coder builder, for two reasons:

Never paste API keys into a chat window with an AI tool, even one you trust. Chat logs can be stored, reviewed, or leaked, and a key pasted into a prompt is now living in a transcript, not a locked vault.

Never let a key get committed into your Git repository. Git remembers everything, forever — even if you delete a secret in a later commit, it's still recoverable from the project's history, and if the repo is public, it's exposed to anyone who looks. Netlify's own documentation is blunt about this: they recommend setting secrets through the platform's dashboard, CLI, or API specifically "to avoid storing sensitive values in your repository," because committed secrets create a permanent trail and remain retrievable even after deletion.

Both Vercel and Netlify let you set different secret values for different contexts — a real payment-processor key for production, a fake "test mode" key for preview deployments — so a reviewer poking around a preview link can never accidentally trigger a real charge or send a real email. Ask your AI agent to confirm any credentials are being added through the hosting platform's environment variable settings, not hardcoded into a file.

05 — What Deploying to Vercel or Netlify Actually Does

"Deploying" sounds abstract. Concretely, here's the mechanism, verified against current Vercel and Netlify documentation:

  1. You connect your Git repository (on GitHub, GitLab, or similar) to Vercel or Netlify.
  2. Every time a commit is pushed — to any branch — the platform notices automatically, because it's watching the repo.
  3. It runs a build: it takes your raw project code and compiles it into the actual files a browser can run (converting, bundling, and optimizing everything).
  4. It deploys those build outputs to its own servers and hands you a unique, live URL.

Vercel documentation puts it plainly: "A deployment on Vercel is the result of a successful build of your project. Each time you deploy, Vercel generates a unique URL." Push to your main branch, and (depending on your settings) that build becomes your production deployment, live at your real domain. Push to any other branch, or open a pull request (a request to merge one branch's changes into another, which is also where human review typically happens), and you get a separate, isolated deployment instead.

06 — Preview Deployments: Your Most Important Tool as a Non-Coder

This is the single most useful mechanism in this entire layer for someone in your seat. A preview deployment (Vercel's term) or Deploy Preview (Netlify's term) is a live, working, fully clickable version of your app built from a specific branch or pull request — but it is not the version real users see.

Netlify's documentation describes it exactly this way: opening a pull request automatically builds a temporary, unique URL (something like deploy-preview-42--yoursite.netlify.app) so you can "preview, review, and test changes to your site without publishing them to production." Vercel's model works the same way — every commit or pull request can trigger its own preview URL, separate from the production domain.

Why this matters for you specifically: you don't need to read code to review a change. You need a link. When your AI agent finishes a feature, the workflow should be: agent commits to a branch → platform auto-builds a preview link → you open that link on your phone or laptop and click around like a real user would → only if it looks right does it get merged and promoted to production. Netlify even supports leaving comments and screenshots directly on the preview page for exactly this kind of non-technical review. This is how a PM with zero coding ability still does meaningful, competent quality control.

07 — A Beginner-Safe Workflow to Insist On

When an AI agent is making the commits, you're not driving — but you should never be a passenger with no seatbelt. Insist on this checklist as a standing rule with any agent you work with:

  • Work happens on a branch, not directly on main. Ask the agent to create a feature branch for each piece of work rather than committing straight to the branch that represents your live product.
  • Review the diff before it merges. A "diff" is just the list of exact lines added or removed. You don't need to understand the code — skim it for anything that looks like a secret, a deleted file you didn't expect, or a change way bigger than what you asked for.
  • Require meaningful commit messages. "Fixed stuff" tells you nothing six weeks from now. Ask the agent to write commit messages that say what changed and why — this becomes your project's memory.
  • Always check the preview link before promoting to production. Never approve a merge based on the agent's description alone — click through the actual preview URL yourself.
  • Know how to roll back. Because every commit is a saved snapshot, undoing a bad deploy is usually one click, not a crisis — Vercel explicitly supports reverting to a previous production deployment, and the same "redeploy an older version" pattern exists on Netlify. Ask your agent up front: "if this breaks, what's the exact rollback step?" and get the answer before you need it.
  • Keep secrets out of the conversation entirely. Set API keys directly in the hosting platform's dashboard; never dictate them to the agent in chat.

Treat this as a standing instruction to any coding agent you use, not a one-time setup step — repeat it at the start of a new project.

08 — Common Mistakes Beginners Make

  • Deploying straight to production. Skipping staging/preview because "it looked fine" is the single most common way small bugs become public embarrassments.
  • Committing secrets by accident. Pasting an API key into a config file the agent then commits — or into the chat itself — is easy to do once and expensive to undo, since Git history keeps it recoverable even after deletion.
  • Ignoring preview links. The whole point of a preview deployment is that a non-coder can review real, running software before it ships. Skipping that step and approving based on the agent's summary defeats the entire safety mechanism.
  • Letting an agent push directly to main. Without a branch and a review step in between, there's no moment where a human actually looks before the change goes live.
  • Vague commit messages. "Update" or "fix" as a commit message means that six months from now, nobody — including your AI agent — can quickly tell what happened or why, which makes rollback and debugging much harder.
  • Not knowing the rollback path. Waiting until something is broken in production to ask "how do we undo this" costs you minutes that matter.

Where this leads

You now understand the physical mechanics of shipping — how code moves from an agent's output to a link you can trust, and the checkpoints that keep that path safe. But a real product rarely stays this simple: it needs to talk to other services, react to events, and run tasks on its own schedule. Layer 07 — Automation & Integrations — picks up right where your deployed app lives and shows you how to connect it to the outside world: webhooks, third-party APIs, and the automations that turn a static app into a living product.