LinuxCommandLibrary

dolt-clone

Clone a Dolt database repository

TLDR

Clone an existing repository into a specific directory (defaults to the repository name)

$ dolt clone [repository_url] [path/to/directory]
copy

Clone an existing repository and add a specific remote (defaults to origin)
$ dolt clone --remote [remote_name] [repository_url]
copy

Clone an existing repository only fetching a specific branch (defaults to all branches)
$ dolt clone [[-b|--branch]] [branch_name] [repository_url]
copy

Clone a repository, using an AWS region (uses the profile's default region if none is provided)
$ dolt clone --aws-region [region_name] [repository_url]
copy

Clone a repository, using an AWS credentials file
$ dolt clone --aws-creds-file [credentials_file] [repository_url]
copy

Clone a repository, using an AWS credentials profile (uses the default profile if none is provided)
$ dolt clone --aws-creds-profile [profile_name] [repository_url]
copy

Clone a repository, using an AWS credentials type
$ dolt clone --aws-creds-type [credentials_type] [repository_url]
copy

SYNOPSIS

dolt clone remote-url [directory]

PARAMETERS

remote-url
    The URL of the Dolt repository to clone. Typically a dolthub:// or http(s):// URL. Example: dolthub://organization/repo

directory
    An optional local directory to create for the cloned repository. If not specified, a directory with the same name as the repository will be created.

--depth depth
    Create a shallow clone with a history truncated to the specified number of commits. Implies --single-branch unless --no-single-branch is given to fetch the histories near the tips of all branches. If you want to clone only the latest version of the repository (equivalent to a depth of 1) using --depth 1 can drastically reduce the cloning time especially for large datasets.

--remote remote
    Instead of using the remote name origin to keep track of the upstream repository, use <remote>.

DESCRIPTION

dolt clone is a command-line tool used to download a copy of a remote Dolt repository to your local machine. Dolt repositories are Git-compatible version-controlled SQL databases. The clone command mirrors the functionality of git clone, creating a local copy of the repository's data, schema, and history.

After cloning, you can interact with the Dolt database locally, including querying, modifying, and committing changes. These changes can then be pushed back to the remote repository. The cloning process downloads all branches and data, allowing offline access and facilitating collaborative data management workflows. dolt clone requires a valid Dolt remote address (typically a dolthub:// URL) as input. It downloads the full version history allowing you to revert to previous database versions, inspect changesets, and participate in collaborative data management workflows, similar to version control for code. Note that cloning a Dolt database is faster than downloading the whole data as it relies on efficient dolt internal storage formats and data compression.

CAVEATS

Cloning a large Dolt repository can take a significant amount of time and disk space, especially when cloning with full history. Shallow clones using --depth can mitigate this. Cloning over HTTPS may be slower than cloning over DoltHub's native protocol.

EXAMPLES

Clone a repository to a directory of the same name:
dolt clone dolthub://my-org/my-repo

Clone a repository to a specific directory:
dolt clone dolthub://my-org/my-repo local-repo

Clone only the latest version of a repository (shallow clone):
dolt clone --depth 1 dolthub://my-org/my-repo

SEE ALSO

dolt remote(1), dolt fetch(1), dolt pull(1), dolt push(1)

Copied to clipboard