Review Diffs Before Syncing
Always review what will change before running a sync operation. The --dry-run flag shows a colored diff without making any changes.
Forward sync diff
Section titled “Forward sync diff”To see what a forward sync would change in the local file:
yarn sync:questionnaire -q <slug> --dry-runThis fetches the current published data from Strapi and shows a diff against the existing local .ts file. Useful for checking if a Strapi edit was made correctly before overwriting the local file.
Reverse sync diff
Section titled “Reverse sync diff”To see what a reverse sync would change in Strapi:
yarn reverse-sync:questionnaire -q <slug> --dry-runThis compares the local file against the current Strapi draft/published state and shows the differences.
Reading the diff
Section titled “Reading the diff”- Green lines — Additions (new content)
- Red lines — Deletions (removed content)
- White lines — Unchanged context
What to look for
Section titled “What to look for”| Check | Why |
|---|---|
| Only your intended changes appear | Confirms you edited the right fields |
| No unintended deletions | Prevents accidentally removing questions or rules |
| String formatting is consistent | Detects whitespace or encoding issues |
| Question IDs are correct | Typos in IDs break rules and navigation |
Force mode
Section titled “Force mode”If you are confident in the changes and want to skip the interactive confirmation prompt:
yarn sync:questionnaire -q <slug> --forceyarn reverse-sync:questionnaire -q <slug> --forceSee also
Section titled “See also”- Sync Commands Reference – full CLI reference for –dry-run and –force flags
- Sync a Questionnaire – forward sync workflow
- Reverse-Sync a Questionnaire – reverse sync workflow