Skip to content

Import a snapshot from Git

Record a Git tree as an AWC snapshot. The manifest stores the source kind as git and records the imported directory path as the locator.

AWC does not clone for you

--source-type git only sets the source kind in the manifest. AWC does not clone, fetch, or parse a Git URL today. The import code path is the same as a directory import. You MUST materialize the tree yourself.

The CLI does not populate source.immutable_revision. It is always null. Record the revision in a label instead.

Before you start

  • Set AWC_TENANT and AWC_PROJECT, or pass --tenant and --project. Snapshot create requires both (spec §13.3).
  • Configure an object store. Export AWC_CAS_URL, or pass --object-store-endpoint. The value must start with memory:// or s3://.

Procedure

  1. Materialize the Git tree to a local directory.
git clone https://example.com/acme/backend.git backend
git -C backend checkout 8e3a2f1

Note the checked-out revision. You pass it as a label in the next step.

  1. Import the directory and record Git provenance.
awcctl snapshot create \
  --from-dir backend \
  --source-type git \
  --name backend-8e3a2f \
  --label repository=acme/backend \
  --label revision=8e3a2f1

--source-type git sets the manifest source kind to git. The default normalization is source-normalized (spec §9.8). It zeroes owner, group, and mtime, and keeps file type plus the executable bit. Pass --normalization environment-preserving to keep captured modes and mtimes. The command prints the snapshot id and a state of VALIDATING.

  1. Poll the snapshot until it reaches READY.
awcctl snapshot inspect snap_01J...

A worker validates object closure, then advances the state VALIDATING -> READY (spec §13.5, §12.1). The snapshot is mountable only at READY.

  1. Confirm the Git source kind.
awcctl snapshot inspect snap_01J...

Read the source line. It shows git. The inspect record exposes the source kind only. The locator and immutable_revision are held in the manifest, which awcctl does not print.

See also