skip to Main Content

I have a project deployed on Vercel, and it’s currently set to deploy from the main branch of my repository. I need to change the deployment branch to a different branch (e.g., develop).

Could someone guide me through the steps to change the branch used for deployment in Vercel? Any detailed instructions or screenshots would be highly appreciated.

I’ve looked through the Vercel dashboard and settings but haven’t been able to find a clear option to change the branch for the deployment.

Thanks in advance!

3

Answers


  1. To change the branch for your deployment in Vercel, follow these steps:

    Navigate to Your Project:

    Log in to your Vercel account.
    Go to the Vercel dashboard and select the project for which you want to change the branch.
    Access Project Settings:

    Click on the project name to open its details.
    Go to the "Settings" tab located at the top of the page.
    Modify Git Settings:

    In the settings sidebar, find and click on "Git".
    Under the "Git" section, you will see a dropdown labeled "Production Branch" or "Git Branch".
    Click on the dropdown menu and select the branch you want to use for deployments (e.g., develop).
    Save Changes:

    After selecting the desired branch, make sure to save your changes.
    Vercel will now use the specified branch for future deployments.
    Screenshots for Reference:
    Unfortunately, Stack Overflow answers typically do not include screenshots directly. However, if needed, you can refer to the Vercel documentation for visual guidance.
    Additional Tips:
    Ensure that your new branch is up-to-date and contains the necessary configuration files for deployment.
    You can also set up preview branches if you want to test deployments from multiple branches simultaneously.
    By following these steps, you should be able to change the deployment branch in Vercel with ease. If you encounter any issues, feel free to ask for further assistance!

    Login or Signup to reply.
  2. In Vercel dashboard, Go to the project.

    In settings select the Git

    Setting section in Vercel project

    Scroll down and rename the production branch name

    Select branch for production

    Save the settings

    save settings

    Login or Signup to reply.
  3. If you already have another branch on your git repository. Then you will find the branch on Vercel project settings Under Domains section.
    Click on your project card. Go to Settings tab. Select Domains.
    See the screenshot:
    Vercel Dashboard Screenshot
    You can select the branch name and save. The next deployment will happened from this branch.

    Thank you

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search