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

# nsc git-checkout update-submodules

Check out submodules in a git checkout on a Namespace runner.

`git-checkout update-submodules` checks out submodules of a git checkout on a Namespace runner, utilizing
Namespace Cache Volumes to speed up the operation on subsequent runs. It performs the equivalent of
`git submodule update --init` on each discovered submodule.

## Prerequisites

The operation must be executed on Namespace [GitHub Runners](/docs/solutions/github-actions) with caching
configured for [Git repository checkouts](/docs/integrations/git-checkouts).

The operation must be executed after a git checkout exists, e.g. after executing [`nscloud-checkout-action`](/docs/reference/github-actions/nscloud-checkout-action).

For the operation to be effective, submodules should not be checked out before running it. In the case of `nscloud-checkout-action`
this means that its `submodules` option of should be either absent or set to false.

## Usage

If the git checkout is on the default path, submodules can be checked out as follows:

```bash theme={null}
nsc git-checkout update-submodules --mirror_base_path=${NSC_GIT_MIRROR} --repository_path=${GITHUB_WORKSPACE} --recurse
```

It is possible to customize the path of the main repository checkout by passing a different value in `--repository-path`.

If `--recurse` is given, `nsc git-checkout update-submodules` will recurse into submodules and check out their submodules, respectively.

## Options

<h3 id="--repository_path">
  \--repository\_path
</h3>

The path of the repository to work in.

<h3 id="--recurse">
  \--recurse
</h3>

If true, will recursively update all submodules.

<h3 id="--depth">
  \--depth
</h3>

Truncate history to the specified number of commits.

<h3 id="--dissociate">
  \--dissociate
</h3>

If true, will dissociate all updated submodule checkouts from the cache.

<h3 id="--filter">
  \--filter
</h3>

If specified, the given partial clone filter will be applied.

<h3 id="--workers">
  \--workers
</h3>

Number of workers for submodule fetch and update operations. Defaults to `4`.
