How-to

Assigning a domain to a Git branch

Learn how to assign a domain to a different Git branch with this guide.
Table of Contents

Every commit pushed to the Production Branch of your connected Git repository will be assigned the domains configured in your project.

To automatically assign a domain to a different branch:

  1. From the dashboard, pick the project to which you would like to assign your domain and select the Settings tab.
  2. Click on the Domains menu item.
  3. Select the Edit button for the domain to which you would like to assign your branch.
  4. In the Git Branch field, enter the branch name to which you would like to assign the domain:
A Custom Domain that is automatically assigned to the `staging` Git Branch.
A Custom Domain that is automatically assigned to the `staging` Git Branch.

Pro and Enterprise teams can also set branch tracking for their custom environments.

If you prefer to do this using the Vercel REST API instead, you can use the "Update a project domain" PATCH endpoint.

Last updated on July 24, 2024