Safely synchronize submodules
Synchronize submodules with pre-flight safety checks.
The sync command performs three critical operations:
-
PRE-FLIGHT CHECKS Verifies no uncommitted changes or unpushed commits that could be lost during synchronization.
-
URL SYNCHRONIZATION Copies URLs from .gitmodules to .git/config, fixing URL mismatches that occur when remote URLs change.
-
SUBMODULE UPDATE Fetches and checks out the correct commits for all submodules.
This order is critical: sync-before-update prevents silent code deletion when URLs change on remote repositories.
EXIT CODES: 0 Success 1 Pre-flight check failed (uncommitted changes) 2 Sync or update operation failed 3 Post-sync validation failed 4 Invalid arguments
EXAMPLES:
camp sync
camp sync --dry-run
camp sync projects/camp
camp sync --force
camp sync --verbose
camp sync --json
camp sync [submodule...] [flags]
-n, --dry-run Show what would happen without making changes
-f, --force Skip safety checks (uncommitted changes warning still shown)
-h, --help help for sync
--json Output results as JSON for scripting
--no-fetch Skip fetching from remote (use local refs only)
-p, --parallel int Number of parallel git operations (default 4)
-v, --verbose Show detailed output for each submodule
--config string config file (default: ~/.obey/campaign/config.json)
--no-color disable colored output
- camp - Campaign management CLI for multi-project AI workspaces