Push to Staging & Production on Netlify

Push to Staging

Assuming you've already set up your staging branch with Netlify, and assuming you're working from the staging branch, use this to simultaneosly push to staging branch and then watch the Netlfiy deployment:

git add .
git commit -m "changes"
git push; netlify watch

Check the staging site by prepending staging-- to the Netlify URL. For example:

https://staging--briancasel.netlify.com

Push to Production

When ready to push to production:

Merge changes from staging to master branch.

Assuming you're now on the master branch, do the same as above to both push to master and watch the Netlify deployment:

git add .
git commit -m "changes"
git push; netlify watch

Last updated