> ## Documentation Index
> Fetch the complete documentation index at: https://namespace.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Git Checkouts

Namespace can speed up your git checkouts by caching a mirror of your git repository on a cache volume.
Checkout caching works best when cloning large repositories with many files.
If you are also checking out submodules or rely on Git LFS, these are automatically cached, too.

### 1. Enable Git checkout caching

Open your runner profile in the [Dashboard](https://cloud.namespace.so/workspace/actions/profiles) and enable **Git repository checkouts** in the caching section.

![profile cache dialog](https://mintcdn.com/namespace-labs/QVtD1jw4ML2vd3TZ/images/github-actions/runnerprofilegitcheckouts.webp?fit=max\&auto=format\&n=QVtD1jw4ML2vd3TZ\&q=85\&s=c57b5af3c4b195fdf77b0589f6fb6be8)

### 2. Configure your workflow

To start using the newly enabled cache in your workflow, replace mentions of `actions/checkout` with [`nscloud-checkout-action`](https://namespace.so/docs/reference/github-actions/nscloud-checkout-action):

```yaml theme={null}
jobs:
  tests:
    runs-on: namespace-profile-integration-tests
    steps:
      - name: Check out my repo
        uses: actions/checkout@v4 # [!code --]
        uses: namespacelabs/nscloud-checkout-action@v8 # [!code ++]
        with:
          path: my-repo
      - run: |
          cd my-repo && git status
```

Check out the [action reference](https://namespace.so/docs/reference/github-actions/nscloud-checkout-action.md) for a full
list of supported options.

If your workflow runs in a container, you also need to mount the git mirror inside the container. See [Running jobs in containers](https://namespace.so/docs/solutions/github-actions/runner-controls/containerized-jobs.md).

## Cache isolation per repository

Namespace automatically creates an isolated cache volume for each GitHub repository that uses git checkout caching.
The cache volume tag follows the schema `github-git-mirror-{owner}-{repository}`, so mirrors from different repositories never collide.

## Expected use cases

The `namespacelabs/nscloud-checkout-action` is optimized to speed up only specific use-cases.
If your workflows do not belong to these, you might not see the expected performance improvement.

* Very large repositories: when the workflow needs to check out a repository with many or big files.
* Checkout long commits history: when the workflow needs to check out many commits (the default is only 1).
* Repositories with a large set of submodules.
* Repositories with Git LFS objects.

## Next steps

* [Cache Volumes overview](https://namespace.so/docs/solutions/github-actions/caching.md)
* [Actions](https://namespace.so/docs/solutions/github-actions/caching/actions.md)

For advanced configuration see [Runner Labels](https://namespace.so/docs/reference/github-actions/runner-configuration.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.