← 返回命令列表

Linux command

jj-commit 命令

文本

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

常用示例

Create a commit with a message

jj commit -m "[message]"

Commit interactively

jj commit -i

Open an editor

jj commit

Commit only specific files

jj commit [path/to/file1] [path/to/file2]

Commit with a specific diff editor tool

jj commit --tool [meld]

Set a message and still open the editor

jj commit -m "[draft message]" --editor

说明

jj commit updates the description of the current working-copy commit and creates a new empty change on top of it. It is equivalent to running jj describe followed by jj new, and has the alias jj ci. When invoked without path arguments or --interactive, all changes in the working copy are included. When paths or --interactive are used, only the selected changes are committed while the remaining changes are moved to the new working-copy commit above. Unlike git, Jujutsu automatically treats the working copy as a mutable commit, so this command finalizes the current changes by setting a description and advancing the working copy.

参数

-m, --message _MESSAGE_
The change description to use (don't open editor).
-i, --interactive
Interactively choose which changes to include in the current commit.
--tool _NAME_
Specify diff editor to be used (implies --interactive).
--editor
Open an editor to edit the change description. Forces an editor even when using --message.

FAQ

What is the jj-commit command used for?

jj commit updates the description of the current working-copy commit and creates a new empty change on top of it. It is equivalent to running jj describe followed by jj new, and has the alias jj ci. When invoked without path arguments or --interactive, all changes in the working copy are included. When paths or --interactive are used, only the selected changes are committed while the remaining changes are moved to the new working-copy commit above. Unlike git, Jujutsu automatically treats the working copy as a mutable commit, so this command finalizes the current changes by setting a description and advancing the working copy.

How do I run a basic jj-commit example?

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

What does -m, --message _MESSAGE_ do in jj-commit?

The change description to use (don't open editor).