snapdir checkout

Check out a snapshot to a directory.

checkout materializes a snapshot that is already in the local cache into a destination directory. By default it only adds or replaces snapshot files; use --delete when the destination should become an exact mirror of the snapshot. If the snapshot is not yet cached, fetch it first with snapdir fetch or use snapdir pull.

Usage

snapdir checkout [OPTIONS] [DIR]

Arguments

Argument Description
[DIR] Destination directory.

Options

Option Description
--store <URI> Store URI accepted by the transfer surface. Env: SNAPDIR_STORE.
--objects-store <URI> Shared object-pool store URI for split snapshots. Env: SNAPDIR_OBJECTS_STORE.
--catalog <NAME> Catalog adapter to record this snapshot's location in. Env: SNAPDIR_CATALOG; unset uses the default catalog, none disables catalog writes.
--cache-dir <DIR> Directory where the object cache is stored. Env: SNAPDIR_CACHE_DIR.
--id <ID> Snapshot ID to check out.
-j, --jobs <N> Max concurrent object transfers. Env: SNAPDIR_JOBS.
--limit-rate <RATE> Limit aggregate transfer bandwidth. Env: SNAPDIR_LIMIT_RATE.
--adaptive[=<FRACTION>] Adaptively tune transfer concurrency/bandwidth. Env: SNAPDIR_ADAPTIVE.
--max-jobs <N> Adaptive concurrency ceiling. Env: SNAPDIR_MAX_JOBS.
--max-retries <N> Total retry attempts per network request, including the first.
--retry-base-ms <MS> Base retry backoff delay in milliseconds.
--retry-max-ms <MS> Maximum retry backoff delay in milliseconds.
--max-requests <N> Cap request rate; 0/unset uses the backend default.
--linked Materialize files as read-only symlinks into local content-addressed objects. Remote stores are refused.
--force Overwrite an existing destination.
--keep / --dryrun Transfer action flags accepted by checkout.
--delete Prune destination entries not present in the snapshot manifest; refuses dangerous destinations even with --force.
--exclude <PATTERN> With --delete, protect destination paths matching the extended-regex pattern from pruning. Repeatable and comma-delimited.
-q, --quiet / --no-progress / --color <WHEN> / --verbose Universal output-control options.

Examples

Check out a cached snapshot into a directory:

snapdir checkout --id 1220abc... ./restored

Check out using read-only symlinks into local objects:

snapdir checkout --id 1220abc... --linked ./readonly-view

Mirror a snapshot into an existing destination, keeping a local file:

snapdir checkout --id 1220abc... --delete --exclude '\.env$' ./served

See also