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

# clone

> Clone a repository into your local drive

```bash theme={null}
dv clone <repo_id> [path] [--workspace <workspace_id>] [--new-workspace] [--ref <ref>]
```

If no path is provided, the cloned repository will be cloned under the current directory in a new folder with the same name as the repository.

The `<workspace_id>` has to be the id that starts with ws., not the name.

`[--workspace <workspace_id>]` specifies an existing workspace to use after cloning.

`[--new-workspace]` forces creating a new workspace rather than prompting.

`[--ref <ref>]` checks out a specific branch name, branch ID, commit ID, or tag ID after cloning. If unspecified, the default branch is checked out.
