I explain how to set up a staging site and version control with Git. I cover branching, approvals, safe merges, and what to check before you go live.
To set up staging and version control, I create separate environments and a Git workflow with reviews and safe merges. This keeps production stable and lets me spot problems early.
Plan environments
- Define development, staging and production, and mirror production settings in staging.
- Protect staging with authentication and separate database and storage.
- Refresh staging from production, masking personal fields with safe dummy values.
Set up version control
- Initialize Git, a version control system for tracking changes and branches.
- Keep main as the stable branch that mirrors production and tag each release.
- Store secrets in environment variables and use .gitignore for build and vendor folders.
Branching and approvals
- Create one short-lived feature branch per change with clear messages.
- Open a merge request for review by a second set of eyes or a checklist.
- Require automated checks to pass before merge, including tests and a staging preview.
Staging build and deploy
- Use CI/CD, automated build and deployment, to push branches to staging.
- Run database migrations on staging first and script the steps.
- Hide unfinished work behind feature flags, switches that turn features on or off.
Safe merges and rollback
- After staging approval, merge to main and deploy to production in a planned window.
- Back up production database and files right before release, and note the backup location.
- Tag each release and practice rollback by redeploying the previous tag.
What to check
- A clear staging banner shows on every page and URLs differ.
- Staging sends a robots meta noindex and is password protected.
- Payments, emails and third party calls use test services only.
- Images, caching and CDN, a content delivery network, match production behavior.
- A recent backup restore test succeeded and you documented the steps.
- Access to Git and hosting uses least privilege and MFA, multi factor authentication.
- Monitoring, error logs and uptime alerts are active and reviewed.
How I can help
If you want predictable site care without surprises, I set up environments, backups, reviews and safe deploys through Hosting & Infrastructure > Plans and Web Hosting. For routine updates, my Web Design & Development > Maintenance Plans and Website Updates keep changes moving. I can add Security & Compliance > WAF & Firewall, and AppWT Analytics shows post release behavior.
Get the next one in your inbox
Pick your topics and how often, from weekly to quarterly. I send a confirmation email first, and you can change or stop it any time.
Get more like this by email








