LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

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 a table to its HEAD version, discarding changes
$ dolt checkout [table_name]
copy
Restore a table as it was at a given commit
$ dolt checkout [commit_hash] -- [table_name]
copy
Create a branch tracking a remote branch
$ dolt checkout --track [origin]/[branch_name]
copy
Discard local changes and force the switch
$ dolt checkout --force [branch_name]
copy

SYNOPSIS

dolt checkout branchdolt checkout table...dolt checkout commit [--] table...dolt checkout -b new-branch [start-point]dolt checkout --track remote/branch

DESCRIPTION

dolt checkout switches branches or restores tables in the working set. Like `git checkout` it serves several purposes: moving between branches, creating branches, and discarding uncommitted changes.Given a branch name, it points the working database at that branch. With -b it creates the branch first. Given one or more table names, it restores those tables to match HEAD, throwing away uncommitted changes; adding a commit before `--` restores them as of that commit instead.Dolt's branches are cheap, since they are pointers into the same content-addressed storage, so branching per feature, per import, or per experiment is a normal workflow on data as well as schema.

PARAMETERS

-b new-branch [start-point]

Create a branch named new-branch starting at start-point (defaults to HEAD) and switch to it.
-B new-branch [start-point]
Like -b, but forcibly resets the branch to start-point if it already exists.
-f, --force
Wipe out the current changes and check out the new branch anyway.
-t, --track
When creating a branch, set up upstream tracking configuration.
--overwrite-ignore
Silently overwrite ignored tables when switching branches.
--no-overwrite-ignore
Abort the checkout if ignored tables would be overwritten.

INSTALL

sudo pacman -S dolt
copy
brew install dolt
copy
nix profile install nixpkgs#dolt
copy

CAVEATS

Restoring a table discards its uncommitted changes with no way back: there is no reflog for the working set. Unlike Git, dolt checkout does not accept a bare commit hash to enter a detached HEAD; use `dolt checkout -b <branch> <commit>` to work from an old commit. When a `dolt sql-server` is running against the database, the CLI shares the server's session state, so checkouts made from the shell are visible to connected clients.

HISTORY

dolt checkout mirrors git checkout for Dolt's versioned database, giving Git users a familiar way to move between branches of data. Dolt has since also grown Git's newer split of the command into `dolt branch` for branch management and `dolt reset`/`dolt revert` for undoing work, but `checkout` remains the everyday entry point.

SEE ALSO

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid