Documentation menu

Conflicts and recovery

Understand keep-both file conflicts, transactional Git conflicts, and isolated recovery exports.

Code Folder Sync never merges lines. If two stable versions cannot both occupy the same canonical state, it keeps both complete byte sequences and records the causal evidence.

Ordinary conflicts

If alpha and beta both savesettings.json from the same base and alpha reaches the hub first, every peer converges to two files:

Filesystem
settings.json
settings.CODEFOLDERSYNC-CONFLICT.beta.8c12f09d.json

The original contains alpha's exact bytes. The sibling contains beta's exact bytes. Executable meaning and symlink target text follow the competing version.

Resolve file conflicts

Terminal
codefoldersync conflicts
codefoldersync history
rg --files /path/to/code | rg 'CODEFOLDERSYNC-CONFLICT'

Inspect both files, create the intended result, then delete or rename the extra sibling with normal filesystem or Git tools. Those changes sync like any other save. Do not delete hub objects or recovery directories to make a conflict disappear.

Git conflicts

Concurrent valid .git states become explicit conflict manifests, not a directory of independently merged refs and indexes. Inspect both histories, then choose deliberately:

Terminal
codefoldersync conflicts
codefoldersync resolve-git <conflict-id> --take canonical
# or
codefoldersync resolve-git <conflict-id> --take conflict

Recover a manifest

Materialize retained content to an unrelated empty destination without changing the synchronized folder:

Terminal
codefoldersync recover <manifest-or-conflict-id> \
  --to /absolute/empty/path

Crash recovery

Replacements, deletes, renames, and Git swaps use durable journals and recovery locations. Startup restores the last local baseline before normal hub reconciliation. Recovery data is retained by default and is a separate crash-safety layer from synchronized conflict siblings.