Linux command
dolt-branch 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
List local branches
dolt branch
List all branches
dolt branch -a
Create a branch
dolt branch [name]
Create a branch
dolt branch [name] [start_point]
Delete a branch
dolt branch -d [name]
Force delete
dolt branch -D [name]
Rename the current branch
dolt branch -m [new_name]
Copy a branch
dolt branch -c [old_name] [new_name]
List remote-tracking branches
dolt branch -r
Show the current branch
dolt branch --show-current
List branches with verbose
dolt branch -v
说明
dolt branch lists, creates, or deletes branches in a Dolt database repository. Branches work like Git branches but for versioned databases, allowing parallel development of database schemas and data. Without arguments, the command lists all local branches with an asterisk marking the current branch. Creating a branch captures the current database state as a starting point for divergent development. Note that creating a branch does not switch to it; use dolt checkout to switch branches. Branches can be used for testing schema changes, experimenting with data transformations, or maintaining multiple versions of a dataset.
参数
- -d, --delete
- Delete a branch. The branch must be fully merged unless -f is also given.
- -D
- Shortcut for --delete --force.
- -m, --move
- Rename a branch.
- -c, --copy
- Copy a branch to a new name.
- -f, --force
- Reset a branch to a start point even if it already exists, force rename/copy even if the target name exists, or allow deleting an unmerged branch.
- -r, --remote
- List or operate on remote-tracking branches.
- -a, --all
- List both local and remote-tracking branches.
- -v, --verbose
- Show commit hash and subject line for each branch. Use -vv to also show upstream branch name.
- -t, --track
- Set up upstream tracking for a remote branch.
- --show-current
- Print the name of the current active branch.
- --list
- Explicitly enter list mode.
FAQ
What is the dolt-branch command used for?
dolt branch lists, creates, or deletes branches in a Dolt database repository. Branches work like Git branches but for versioned databases, allowing parallel development of database schemas and data. Without arguments, the command lists all local branches with an asterisk marking the current branch. Creating a branch captures the current database state as a starting point for divergent development. Note that creating a branch does not switch to it; use dolt checkout to switch branches. Branches can be used for testing schema changes, experimenting with data transformations, or maintaining multiple versions of a dataset.
How do I run a basic dolt-branch example?
Run `dolt branch` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -d, --delete do in dolt-branch?
Delete a branch. The branch must be fully merged unless -f is also given.