← 返回命令列表

Linux command

dolt-commit 命令

文本

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

常用示例

Commit staged changes

dolt commit -m "[message]"

Commit all changes

dolt commit -am "[message]"

Amend last commit

dolt commit --amend

Commit with a specific author

dolt commit -m "[message]" --author "[Name <email>]"

Create an empty commit

dolt commit --allow-empty -m "[message]"

说明

dolt commit records changes to the database repository by creating a new commit with staged table modifications. It captures a snapshot of the current state of all staged tables, preserving the data and schema at that moment in the repository's history. Each commit requires a message describing the changes, creating an audit trail of database evolution over time. The command mirrors Git's commit workflow but operates on database tables instead of files, enabling version control for data. Commits can be amended, authored by different users, and can include all modified tables automatically with the -a flag. Use -A (uppercase) to also include new untracked tables. Empty commits are rejected by default to prevent meaningless history entries.

参数

-m, --message _string_
Commit message.
-a, --all
Stage all modified tables and commit.
--amend
Amend the previous commit instead of creating a new one.
--author _string_
Override the commit author (format: "Name <email>").
--date _string_
Override the commit date.
--allow-empty
Allow creating a commit with no changes.
--force
Force the commit, ignoring any warnings.
-A, --ALL
Stage all tables (including new and untracked) and commit.

FAQ

What is the dolt-commit command used for?

dolt commit records changes to the database repository by creating a new commit with staged table modifications. It captures a snapshot of the current state of all staged tables, preserving the data and schema at that moment in the repository's history. Each commit requires a message describing the changes, creating an audit trail of database evolution over time. The command mirrors Git's commit workflow but operates on database tables instead of files, enabling version control for data. Commits can be amended, authored by different users, and can include all modified tables automatically with the -a flag. Use -A (uppercase) to also include new untracked tables. Empty commits are rejected by default to prevent meaningless history entries.

How do I run a basic dolt-commit example?

Run `dolt commit -m "[message]"` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -m, --message _string_ do in dolt-commit?

Commit message.