Preview vs production: where does my push go?

safe beginner #preview#production#branch#deploy

When to use this: You pushed and want to know whether the live site changed, or how to test safely first.

Before you start

Steps

  1. Preview: push any other branch

    terminal
    git push -u origin my-branch

    Vercel builds it and gives a unique preview URL (shown in the dashboard, and as a comment on a pull request). The live site is unchanged.

  2. Production: push or merge to main

    terminal
    git switch main
    git merge my-branch
    git push

    The new main commit becomes the Production deployment and the domain now serves it.

  3. Find the right deployment

    Vercel dashboard, your project, 'Deployments'. Each row shows the environment (Production or Preview), the branch and commit message, and its status.

How to verify it worked

  • The latest deployment on main is labelled Production and Ready.

How to undo it

Bad production deploy: use Instant Rollback in the dashboard (see the rollback scenario).

Common errors and fixes

Preview works but production fails Environment variables are set per environment. Check Settings, Environment Variables: the variable may exist only for Preview.
Pushed to a branch and nothing deployed Check Settings, Git for 'Ignored Build Step' or disabled previews, and that the branch is not excluded.

Q&A

Can I change which branch is production?

Yes: Project, Settings, Environments (or Git), Production Branch.

Are previews public?

They have unguessable URLs, but depending on plan and settings Vercel can require login (Deployment Protection). Do not put secrets in preview content.

Practice these as flashcards →

Terms in this scenario

Related scenarios

My notes

Saved in this browser only.