Git deployment workflow

Separate Preview and Production

Understand the default environments and keep unreviewed branch work away from the user-facing production domains.

8 minute lesson

~~~

Vercel provides Local, Preview, and Production environments. Each deployment belongs to an environment and receives its own URL.

A push to the configured production branch normally creates a Production deployment. Other branches and pull requests create Preview deployments. The production domain is reassigned only when a Production deployment succeeds. Keep environment values separate because a preview should not write to a production database by accident.

A Preview deployment is a real deployed application, not a harmless screenshot. It can send email, mutate storage, call paid APIs, and expose unfinished routes. Give Preview separate credentials and disposable data, protect it when necessary, and make destructive integrations inert unless the test requires them.

The unique deployment URL identifies one build, while branch aliases can move as new commits arrive. Verify the commit and environment shown by the deployment before reviewing it. A successful Preview also does not guarantee Production will behave identically when domains, secrets, data, or plan limits differ.

Create a feature branch with a visible footer change, push it, and compare its preview URL with the current production URL.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →