> ## 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

export const CenteredImage = ({src, alt, width, caption, className}) => {
  const [basePath, setBasePath] = useState("");
  useEffect(() => {
    const path = window.location.pathname;
    setBasePath(path === "/docs" || path.startsWith("/docs/") ? "/docs" : "");
  }, []);
  return <Frame caption={caption} className={className} style={{
    maxWidth: width,
    marginInline: "auto"
  }}>
			<OptimizedImage src={`${basePath}${src}`} alt={alt} />
		</Frame>;
};

Namespace can speed up your git checkouts by caching a mirror of your git repository.
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.

## Getting started

When running your GitHub Actions on [Namespace runners](/docs/solutions/github-actions), cached git checkouts are available directly from the UI.

<Steps titleSize="h3">
  <Step title="Enable Git Checkout caching">
    In your runner profile, enable **Git repository checkouts** in the caching section.

    <CenteredImage width={600} alt="profile cache dialog" src="/docs/images/github-actions/runnerprofilegitcheckouts.png" />
  </Step>

  <Step title="Configure your workflow">
    To start using the newly enabled cache in your workflow, replace mentions of `actions/checkout` with [`nscloud-checkout-action`](/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](/docs/reference/github-actions/nscloud-checkout-action) for a full
    list of supported options.
  </Step>
</Steps>

## How it works

Namespace retains a mirror of your git repository on [Cache Volumes](/docs/architecture/storage/cache-volumes), making them available on subsequent runs.
Cache Volumes are Namespace's high-performance caching solution that persists data across GitHub Actions runs.
Unlike traditional caching solutions that require time-consuming uploads and downloads, Cache Volumes provide **instant access to cached data** through guaranteed cache locality.

Learn more about Namespace's comprehensive [caching solutions](/docs/solutions/github-actions/caching).
