> For the complete documentation index, see [llms.txt](https://docs.flxbl.io/flxbl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flxbl.io/flxbl/codev/ci-cd/sync/sync-to-environment.md).

# Syncing to a Named Environment

```
sfp sync qa
```

Commenting this on a pull request deploys the PR's changes to the named environment. Because the target is a **shared** environment, the sync is approval-gated: codev posts an approval request on the PR, and an owner must approve before anything is deployed.

{% hint style="warning" %}
**Use this sparingly.** A named environment is shared — pushing unmerged code into it puts changes in front of testers that may never merge in that form, and makes the environment drift from what the release process says is deployed there. For day-to-day iteration, [sync your review environment](/flxbl/codev/ci-cd/sync/sync-review-environment.md) instead; it needs no approval and affects nobody else. See [which one should I use?](/flxbl/codev/ci-cd/sync.md#which-one-should-i-use)
{% endhint %}

## What happens

1. **You comment** `sfp sync qa` on the pull request.
2. **codev asks for approval** — a comment explains what is about to happen and who can approve. An owner replies `/codev approve qa` (or `/codev reject qa`).
3. **The environment is locked** so nothing else deploys to it mid-sync.
4. **The PR's merge state is checked out** — what your branch will look like *after* merging, not just the branch by itself.
5. **The changes are deployed**, and the lock is released.
6. **A completion comment tells you exactly what was deployed.**

<figure><img src="/files/ugs2KX6ebRaYM38KIyfw" alt="A sync-to-environment run in Workflows > Runs"><figcaption><p>Every sync is a workflow run — follow each step live under <strong>Workflows > Runs</strong></p></figcaption></figure>

## Changed files or full packages?

By default, `sfp sync` uses **diff-deploy**: it takes only the files your PR changed and deploys them directly, running just the relevant tests. This is the fastest way to get a change onto an environment for a look.

```
sfp sync qa                 # changed files only (diff-deploy) — fast
sfp sync qa --full-build    # build and install the affected packages properly
```

Diff-deploy is deliberately lightweight — it leaves **no trace in tracking**: no artifact records, no version history, no package registry entries. It's for iterating, not for promoting. When you want the environment to reflect properly built and tracked package versions, use `--full-build` — or merge and let the normal [build](/flxbl/codev/ci-cd/overview.md) and [release](/flxbl/codev/ci-cd/overview-3.md) flow take over.

{% hint style="info" %}
Pre/post deployment scripts and permission set assignments are skipped in diff-deploy mode. If your change relies on them, use `--full-build`.
{% endhint %}

## Narrowing the sync

```
sfp sync staging --domain sales          # only the sales domain's packages
sfp sync uat --packages pkg-a,pkg-b      # only specific packages
```

## When it's the right tool

* **A stakeholder demo** that must show a fix on a known environment today, ahead of the release.
* **Verifying a hotfix against an environment's exact shape** before merging it.
* **An urgent investigation** where reproducing on the review environment isn't possible.

If your team is syncing to named environments routinely, that's usually a sign the review-environment setup or the release cadence needs attention — not that more syncs are needed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flxbl.io/flxbl/codev/ci-cd/sync/sync-to-environment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
