Deploying to staging before deploying to prod help

Hey Netlify Team,
I’m working on a new site and currently have it deploying successfully to an external url and dns -
The current internal site name is: frosty-payne-d77a90

My main question is when I do a git commit / push, Netlify builds and pushes that code basically to production. How do I build and deploy this code to the staging preview first, review and then push to production / live? Right now it seems to do both at the same time with one git push.

Currently I work in the main branch, make changes, save changes and push to the main branch - I’m the only developer on this project. Reading through the docs do I need to a make something like a staging branch and work off that and push that code first? Not 100% sure what to do here so any help would be awesome to help my workflow!

Thanks in advance!

Hey Spencer,

That’s exactly right! Rather than updating the master branch, you’d need a secondary branch, e.g. staging, where you can make your changes, test them and then PR and merge to master.

I’ve checked your site and it appears that you’ve adopted this already, now making use of deploy previews.

Happy to help further if needed!

Thanks @Pie - I’ve never had to do that before but Netlify is so intuitive I was able to figure it out. Thanks again for taking a look!

No problem; I’m glad you’re enjoying the service!