Is there a way to select a custom branch to deploy ? I do not seem to be able to select a branch and it takes the default main branch
thanks in advance
Is there a way to select a custom branch to deploy ? I do not seem to be able to select a branch and it takes the default main branch
thanks in advance
Vercel automatically deploys any commit you push to a branch.
You can also customize which branch is used as the Production Branch in the project settings: Go to Project Settings > Git > Production Branch
This works for me: add the code to vercel.json file in root directory:
{
"env": {
"BRANCH": "custom-branch"
},
"scripts": {
"vercel-deploy": "if [ \"$BRANCH\" != \"main\" ]; then echo \"Cannot deploy from $BRANCH branch\"; exit 1; fi"
}
}
Seems no way to choose a branch when creating a new project. But, after deployment first, you can change Production Branch in Settings/Git configuration.
If you want to deploy a branch without pushing a commit, you can use vercel-cli
.
To re-deploy the preview environment:
vercel --force
To re-deploy the production environment:
vercel --prod --force
If you haven't setup vercel-cli
yet check Vercel's CLI document
I am able to view the latest commit made on my repo by heading to Deployments
tab then click the three dots of a specific commit that you want to deploy. Choose the Redeploy
option from the drop down list.
if you wants' to deploy your code in another branch so please make sure first update your another branch as a main branch on github then you can deploy you main branch in vercel. but theirs is no any other way to deploy your another branch on vercel. Thank you!
you need to change on github repo by changing the default repo to where every you want it go to github setting in general then go to defaultenter image description here branch you can get the default branch then change it there
go to the Deployments tab choose your latest commit on the branch and click on the 3 dots initially current
tag is on main branch
once you click on 3 dots: promote it to [branch name]
there are a few things which you need to manually tweak.
© 2022 - 2024 — McMap. All rights reserved.