Overview
When multiple people work on the same Kodexa environment — some editing resources in the UI and others pushing changes from YAML files — conflicts can occur. The CLI uses sync state files to detect when a resource on the server has changed since your last pull. This prevents accidental overwrites where one person’s changes silently replace another’s, giving you the chance to review and merge before pushing.How It Works
Each time you runkdx sync pull, the CLI records the changeSequence of every fetched resource in a state file at .sync-state/<env>.yaml. When you later run kdx sync push, the CLI compares the stored sequence against the server’s current value:
Example Conflict Output
When a conflict is detected, you will see a warning like:The --force Flag
Use --force to push conflicted resources anyway, overwriting server-side changes:
Deletions Inside a Resource
Conflict detection decides whether a resource is safe to write. A separate comparison decides whether a resource changed at all — and in two regions, content removed from your YAML counts as a change that must be pushed:
Remove content from either region and push again: the resource is reported as changed and the content is removed on the server, so turning a setting off no longer requires writing it out explicitly as
false.
Absence is not authorship — only a region your file actually authors is compared for removed keys:
- A file that omits
metadata.propertiesentirely leaves properties set in the UI untouched. - An explicit
metadata: {}orproperties: {}states that everything below it is empty, and clears it. - A bare
taxons:with no value — the natural result of commenting out every taxon — is treated as unmanaged, not as a deletion. An explicit empty list,taxons: [], is the delete-all spelling and does remove every taxon.
id, changeSequence and ref, are ignored so they never mark a resource dirty.
Deletions inside these regions converge on Kodexa platform (V2) environments. Legacy environments keep the previous behavior, where removing content compares as unchanged.
Sync State Files
State files are stored at.sync-state/<env>.yaml in your repository root, one per environment:
Recommended Workflow
For teams where some users edit resources in the Kodexa UI while others manage YAML files:Environment Name Resolution
The state file name is derived from the environment:--env dev4creates.sync-state/dev4.yaml--to-url https://dev4.kodexacloud.comcreates.sync-state/dev4.kodexacloud.com.yaml--to-profile myprofilederives the name from the profile’s URL
dev4 has no effect on pushes to staging.