Reset and Merge Behavior

Modern LeadCMS pull commands support both scoped reset and three-way merge for content.

Reset flags

Use reset when local files or sync tokens are stale and you need a clean baseline.

Full reset

pnpm exec leadcms pull --reset

This clears local state for supported pull entities and downloads fresh data.

Scoped reset

pnpm exec leadcms pull-content --reset
pnpm exec leadcms pull-media --reset
pnpm exec leadcms pull-comments --reset
pnpm exec leadcms pull-email-templates --reset
pnpm exec leadcms pull-settings --reset

Each command resets only its own entity scope.

In multi‑remote mode, reset applies to the active remote's sync state. For example:

npx leadcms pull --reset -r dev
npx leadcms pull-email-templates --reset -r prod

This clears the selected remote's token and rebuilds its state from a fresh pull.

Three-way content merge

During incremental content pulls, the SDK can merge:

  • your local edits,
  • remote updates,
  • and server-provided base snapshots.

This helps preserve local changes while pulling upstream edits.

Server requirement

Three-way merge requires LeadCMS server support for base snapshots (includeBase) introduced in newer versions (v1.3.18-pre+). On older servers, pull still works but behaves as overwrite sync.

Force overwrite

If you want remote to always replace local content during pull:

pnpm exec leadcms pull --force
# or
pnpm exec leadcms pull-content --force

Use this when you intentionally do not want merge/conflict handling.

When pulling content or email templates from a non-default remote, local files still keep the default remote's id, createdAt, and updatedAt. The pulled remote's own values are stored in that remote's state files under .leadcms/remotes/<name>/.

Conflict markers

When both local and remote modify overlapping parts of content, pull may create conflict markers in local files. Resolve these manually, then continue normal status/push workflow.

Recommended recovery workflow

  1. Try normal pull: leadcms pull
  2. If conflicts appear, resolve them locally.
  3. If local state is inconsistent, run scoped reset (or full reset).
  4. Re-run status and continue with push.

Next steps