← 返回命令列表

Linux command

dolt-checkout 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Switch to branch

dolt checkout [branch_name]

Create and switch

dolt checkout -b [new_branch]

Restore table

dolt checkout [table_name]

Checkout specific commit

dolt checkout [commit_hash]

说明

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.

参数

-b _BRANCH_
Create new branch and switch to it.
-B _BRANCH_
Create/reset branch and switch to it.
--help
Display help information.

FAQ

What is the dolt-checkout command used for?

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.

How do I run a basic dolt-checkout example?

Run `dolt checkout [branch_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -b _BRANCH_ do in dolt-checkout?

Create new branch and switch to it.