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 [options...] <remote_url> [<local_dir>]

PARAMETERS

--branch, -b <branch>
    Initial branches to checkout after clone (repeatable)

--depth <int>
    Shallow clone depth (default unlimited)

--jobs, -j <int>
    Parallelism for clone (-1 all cores; default 1)

--single-branch
    Clone history only for specified branch

--stats
    Print transfer statistics to stderr

-v, --verbose
    Verbose output

DESCRIPTION

dolt clone creates a complete local copy of a remote Dolt database, including its schema, data tables, and full version history. Dolt is a version-controlled SQL database that extends Git functionality to structured data.

Unlike git clone, which handles code diffs, dolt clone fetches both schema changes and actual data rows across commits. This makes Dolt ideal for data engineering, analytics, and collaborative database workflows.

Specify a remote URL (e.g., DoltHub: https://doltremoteapi.dolthub.com/org/repo, or local file paths). Optionally set a local directory; defaults to repo basename.

Supports shallow clones for efficiency, parallel fetching for speed, and branch selection. After cloning, the local repo is ready for dolt checkout, dolt pull, or SQL queries via dolt sql.

Clones are writable; push changes back with dolt push. Large datasets may require ample disk space due to data duplication in history.

CAVEATS

Clones duplicate data across history, leading to high disk usage for large databases. Shallow clones mitigate but limit history. Requires Dolt binary installed.

REMOTE FORMATS

DoltHub (doltremoteapi), AWS S3, Azure Blob, Google GCS, local files, or doltremoteapi servers.

POST-CLONE WORKFLOW

Run dolt sql for queries, dolt branch for new branches, dolt add/dolt commit for changes.

HISTORY

Introduced with Dolt v0.20.0 (2020) by DoltHub team. Evolved with parallel cloning (v1.0+), DoltHub integration, and cloud storage support (S3, Azure). Mirrors Git clone but optimized for SQL data versioning.

SEE ALSO

git-clone(1), dolt-fetch(1), dolt-checkout(1), dolt-pull(1)

Copied to clipboard