---
title: "3x faster git checkouts with StarSling Disks"
description: "Add git-mirror: true to starslingdev/disks for 3x faster git checkouts in GitHub Actions. Keep actions/checkout and download only what changed."
date: 2026-11-24
url: https://starsling.dev/blog/git-mirror
canonicalUrl: https://starsling.dev/blog/git-mirror
---

# 3x faster git checkouts with StarSling Disks

<figure>
  [Image: A tight row of dark frosted glass plates standing on a reflective obsidian floor in Prussian blue and verdigris teal, with a single marigold-edged glass pane streaking rapidly ahead to the right trailing luminous teal and gold speed lines]
</figure>

Starting today, [StarSling Disks](/blog/disks) speed up checkouts with the new [`git-mirror`](https://docs.starsling.dev/runners/disks#faster-checkout-git-mirror) input. StarSling keeps a snapshot of a recent default-branch commit, so set it to true in a job, and that job's git checkout on [StarSling Runners](/products/runners) runs up to 3x faster.

Every GitHub Actions job checks out the repository before its first real step, and `actions/checkout` downloads the full tree of the commit each time. On a large repository that download often takes 10 seconds or more, on every job. Earlier this month we launched [StarSling Disks](/blog/disks), persistent filesystems mounted into StarSling Runners. `git-mirror` puts the checkout on a Disk too.

Your workflow keeps its `actions/checkout` step. Before the first step runs, StarSling copies a recent commit of your default branch from a Disk named `git` into the job's workspace, so `actions/checkout` downloads only what changed since that commit.

## 3x faster checkouts

| Checkout | Mastra jobs | Checkout size | Checkout ready |
| --- | ---: | ---: | ---: |
| GitHub `actions/checkout` | 10 | 25,308 files, 64.6 MiB | 10.4 s |
| StarSling `git-mirror` | 10 | 25,308 files, 64.6 MiB | 3.5 s |
| **StarSling speedup** | | Same commit | **3.0x** |

Checkout ready is the time from the start of the checkout until the workspace holds the commit under test, including the 0.41 s copy from the `git` disk. All times are medians on a StarSling 4 vCPU runner, with every job checking out the same Mastra commit and the stored copy 12 hours older than that commit.

[Mastra](/customers/mastra) turned on `git-mirror` for 24 of its CI jobs by merging [one pull request](https://github.com/mastra-ai/mastra/pull/31213), opened by a StarSling agent. The pull request has the full A/B: every job with `git-mirror` finished its checkout faster than the fastest standard checkout.

## How `git-mirror` works

The `git` disk holds one commit of your default branch, without its history.

- **Seed.** The runner reads `git-mirror: true` from the workflow before any step starts, and copies the stored commit into the job's empty workspace.
- **Check out.** Your `actions/checkout` step runs first, as it does today. The workspace already holds a recent commit of your default branch, so the step downloads only what changed between that commit and the commit under test.
- **Refresh.** The first successful default-branch job (push, schedule, or manual run) with `git-mirror: true` creates the copy. After that, such a job rebuilds it when its commit is 12 hours or more newer than the stored one.
- **Self-contained.** The copy lands in the workspace's own `.git` folder, so a Docker step that mounts the workspace sees a complete repository.

## What changes in a job

`git-mirror` is set in the workflow file and runs on the same Disks as your dependency stores and build output.

| | Standard `actions/checkout` | With `git-mirror` |
| --- | --- | --- |
| Checkout action | `actions/checkout` | `actions/checkout` (unchanged) |
| Download from GitHub | The full tree of the commit, on every job | What changed since the stored commit |
| Configuration | Workflow YAML | `git-mirror: true` in workflow YAML |
| Storage | Ephemeral runner disk | StarSling Disk (`git`), managed with `sling disks` |
| Workspace layout | Self-contained working tree | Self-contained working tree |

Like every Disk, the `git` disk encrypts file contents and filenames at rest, with a unique key for each storage layer. Default-branch jobs update it, pull requests and other branches read it, and forks and Dependabot runs stay isolated from it.

## Add `git-mirror` to a workflow

Run the job on a StarSling Runners label, grant `id-token: write`, keep `actions/checkout` as the first step, and pass `git-mirror: true` to `starslingdev/disks@v0`:

```yaml
jobs:
  test:
    runs-on: starsling-ubuntu-26.04
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@v4

      - uses: starslingdev/disks@v0
        with:
          git-mirror: true

      - run: pnpm test
```

When you add the step:

- **Use a literal flag on an unconditional step.** The runner reads the workflow before any step runs, so write `git-mirror: true` as a literal value on a step with no `if:`.
- **Start with a plain checkout.** The copy seeds jobs whose steps run directly on the runner and whose first step is `actions/checkout` of this repository, with no `if:` or `path`, and a `fetch-depth` of 1 or more. The default depth is 1.
- **Grant OIDC.** Each job with `git-mirror: true` needs `id-token: write`, so StarSling can verify the job through GitHub OIDC.
- **Combine it with other Disks.** `git-mirror: true` can stand on its own step or share a job with other Disks steps, such as `preset: pnpm-store` or `preset: cargo-target`.
- **Manage it with `sling disks`.** See the `git` disk with `sling disks list`. To turn it off, remove the flag from your workflows, then run `sling disks delete git --repo <owner/name>`. The [`sling disks` reference](https://docs.starsling.dev/sling-cli/commands/disks) and the [Disks docs](https://docs.starsling.dev/runners/disks#faster-checkout-git-mirror) have the details.

The action is open source at [starslingdev/disks](https://github.com/starslingdev/disks).

## Pricing

The `git` disk counts toward your [StarSling Disks storage](https://docs.starsling.dev/pricing#disks) at **$0.50 per GB-month**, measured daily, with no per-job attach fee. It holds one compressed commit, with no history.

## Enable `git-mirror` today

`git-mirror` is available to every organization on StarSling Runners with billing set up. [Sign up with GitHub](https://runners.starsling.dev/login) and add `git-mirror: true` to your workflows. Once a default-branch job with the flag succeeds, later jobs with the flag start from the copy.
