LinuxCommandLibrary

dolt-checkout

switch branches or restore working tables

TLDR

Switch to branch

$ dolt checkout [branch_name]
copy
Create and switch to new branch
$ dolt checkout -b [new_branch]
copy
Restore table to HEAD version
$ dolt checkout [table_name]
copy
Checkout specific commit
$ dolt checkout [commit_hash]
copy

SYNOPSIS

dolt checkout [options] [branch|table|commit]

DESCRIPTION

dolt checkout switches branches or restores working tree tables. Like git checkout, it serves multiple purposes: switching between branches, creating new branches, and discarding local changes.
When given a branch name, it switches the working database to that branch. With -b, it creates a new branch and switches to it. When given a table name, it restores that table to match HEAD, discarding uncommitted changes.
This command is fundamental for working with Dolt's branching model, enabling parallel development workflows on database data.

PARAMETERS

BRANCH

Branch name to switch to.
TABLE
Table to restore from HEAD.
COMMIT
Commit hash to checkout.
-b BRANCH
Create new branch and switch to it.
-B BRANCH
Create/reset branch and switch to it.
--help
Display help information.

CAVEATS

Uncommitted changes may block checkout. Detached HEAD state possible with commit checkout. Table checkout discards changes irreversibly.

HISTORY

dolt checkout mirrors git checkout functionality for Dolt's versioned database system, providing familiar branch management operations for database version control.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community