Staging Branch Deploy

Purpose: use a separate Git branch to preview, test, or share work without deploying it to production.

One-time setup

Create a staging branch from the current local work:

git status
git switch -c staging
git push --set-upstream origin staging

git switch -c staging Creates a new branch named staging and switches to it git push --set-upstream origin staging Pushes and explicitly sets the local staging branch to the remote

4. Enabling the staging branch deploy in Netlify

Project configuration
→ Build & deploy
→ Continuous Deployment
→ Branches and deploy contexts
→ Configure
→ Add branch: staging
→ Save

Access the staging site

Check:

Netlify → Site → Deploys → staging deploy → Open

Typical branch deploy URL:

https://staging--site-name.netlify.app

Updating staging later

git switch staging
git add .
git commit -m "update staging"
git push