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.
In order to automatically assign a domain to a different branch, you can enter it in the Git Branch field of your Domain:
![A Custom Domain that is automatically assigned to the `staging` Git Branch.](/_next/image?url=https%3A%2F%2Fassets.vercel.com%2Fimage%2Fupload%2Fv1689795055%2Fdocs-assets%2Fstatic%2Fdocs%2Fconcepts%2Fprojects%2Fcustom-domains%2Fbranch-domains.png&w=1920&q=75)
![A Custom Domain that is automatically assigned to the `staging` Git Branch.](/_next/image?url=https%3A%2F%2Fassets.vercel.com%2Fimage%2Fupload%2Fv1689795055%2Fdocs-assets%2Fstatic%2Fdocs%2Fconcepts%2Fprojects%2Fcustom-domains%2Fbranch-domains-dark.png&w=1920&q=75)
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 September 6, 2024
Was this helpful?