Skip to main content
Git snapshots prepare a repository and working tree once, package them as a snapshot, and reuse that snapshot across ephemeral runners. A runner downloads and extracts the snapshot instead of fetching Git history and checking out every file itself. This is most useful for large repositories where checkout time is a significant part of each job. Snapshots are keyed by the resolved commit, so repeated checkouts of the same commit reuse the same immutable snapshot.
Git snapshots are in early access. Reach out to enable them for your workspace.Git snapshots are intended to supersede Git checkout caching.Contact support →

Requirements

  • A GitHub repository.
  • A Namespace Linux or macOS runner.
  • A GitHub association that gives Namespace read-only access to the target organization and repositories.

Use Git snapshots in a workflow

Replace actions/checkout with namespace-actions/code-checkout:
By default, the action checks out the workflow’s commit ($GITHUB_SHA) into $GITHUB_WORKSPACE. It uses the runner’s Namespace credentials, so no GitHub token is needed. The same step works on Linux and macOS runners, on both x64 and arm64. To run the job on macOS, replace runs-on with your Namespace macOS runner profile.
Versioned releases of the action are not published yet. Pin it to a full commit SHA for reproducible workflows.

Inputs

For example, to check out into a subdirectory and also fetch main for comparison:
For pull requests, the default ref is the workflow SHA, which is normally GitHub’s merge commit. To check out the pull request’s head commit instead, set ref: ${{ github.event.pull_request.head.sha }}.

Differences from actions/checkout

The action does not support every actions/checkout option:
  • It does not clean a nonempty destination or persist GitHub credentials.
  • It does not expose submodule, LFS, sparse-checkout, or fetch-depth settings.
  • GitHub Enterprise and Windows runners are not supported.
  • Snapshot and authentication failures fail the step. There is no fallback to a direct Git clone.
See the action repository for more details.

How it works

Whenever a ref is requested, Namespace generates a snapshot of the repository contents and serves it from an internal Namespace cache. When multiple jobs request the same ref, as commonly happens in CI, the same snapshot is served to each job. This amortizes the checkout time across those jobs. Snapshots are ephemeral and are removed automatically after some time.
Last modified on September 29, 2026