Deploying Staging → Dev (without Dev → Staging)

Deployment from Target to source

Why this flow?

In Umbraco Cloud (or Umbraco Deploy setups), promoting Dev → Staging automatically performs two actions under the hood:

  1. It pulls Staging into Dev to synchronize changes.

  2. Then it pushes Dev to Staging to complete the deployment.

However, sometimes you might have unfinished work on Dev — new features, schema updates, or configuration changes — that are not yet ready to be deployed.
In such cases, promoting Dev → Staging would unintentionally push those incomplete updates.

To avoid this, you can manually pull changes from Staging into Dev without promoting, keeping Staging untouched and in a stable state.
This ensures both environments stay in sync without risking premature deployments.

Steps to follow

Clone Dev

This creates a fresh local copy of your Dev environment repository and moves you into that folder.
All upcoming commands will be executed inside this cloned Dev repo.

git clone <DEV_GIT_URL> umbraco-dev
cd umbraco-dev

Confirm you’re on Dev’s main branch

Before syncing, make sure you’re working on the correct branch,  which is typically master.
This avoids merging Staging changes into a feature branch by mistake.

git status
git branch
# switch if needed:
git checkout master

Add Staging as a second remote

git remote add STAGE <STAGING_GIT_URL>

This links your local Dev repo with the Staging repository, allowing you to fetch or pull code from it.
You will now have two remotes:

  • origin → Dev

  • STAGE → Staging

You can check this anytime with:

git remote -v

Fetch Staging

This retrieves all the latest commits from the Staging environment without merging them yet.
It updates your local knowledge of Staging’s history and prepares you for merging.

git fetch STAGE

Merge Staging into your Dev working branch

This brings all recent changes from Staging into your current Dev branch.
It is equivalent to doing both a fetch and a merge in one command.
If any files have changed in both environments, Git will show merge conflicts for you to resolve.

git pull STAGE master

Stage the changes

Stage all new and modified files.

git add .

Commit

git commit -m "Merge STAGE/master into Dev to sync from Staging"

This command creates a new commit in your local repository that records the changes you just merged from the Staging branch into Dev.
The -m flag adds a short descriptive message explaining what the commit represents, in this case, that you’ve synchronized Dev with the latest updates from Staging.

Push back to Dev (NOT to Staging)

This updates the Dev environment on Umbraco Cloud with your merged changes.
It triggers a Deploy extraction on Dev, while Staging remains untouched until you explicitly deploy later.

git push