Description
Ensure the project's production branch is set to a stable, protected branch such as main, and that production deployments come only from that branch. The branch should have protection rules in the Git provider, such as required reviews, so changes cannot reach production without approval.
Rationale
If production is linked to a feature branch or an unprotected branch, untested or unreviewed code can go live immediately. Production deployments made directly from local machines also skip review. Using a stable, protected branch makes sure every production change has been reviewed and tested before users see it.
Impact
Only reviewed code reaches production
Reduces the risk of broken or malicious releases
Direct CLI production deploys should be limited
Default Value
By default, the production branch is the repository's default branch, often main. It can be changed in the project's Environments settings.
Pre-Requisites
Team Owner or Member role, or Project Administrator
Admin access to the Git repository to set branch protection
Test Plan
Sign in to Vercel at https://vercel.com.
Select your team from the team switcher.
Select the project from the dashboard.
Open Settings in the sidebar, select Environments, and open Production.
In the Branch Tracking section, verify that it shows Branch is followed by a stable branch such as main. The Environments list also shows this branch next to Production.
Open Deployments, filter by Production, and verify that recent production deployments came from that branch.
In your Git provider, verify that the branch has protection rules such as required reviews.
If any of these fail, follow the implementation steps.
Implementation Steps
Sign in to Vercel at https://vercel.com.
Select your team from the team switcher.
Select the project from the dashboard.
Open Settings in the sidebar, select Environments, and open Production.
In the Branch Tracking section, keep Branch is selected, enter your stable branch (for example, main), and select Save.
In your Git provider, add branch protection rules that require pull request reviews for that branch.
Backout Plan
Sign in to Vercel at https://vercel.com.
Select your team from the team switcher.
Select the project from the dashboard.
Open Settings > Environments > Production and set Branch Tracking back to the previous branch.
Reference