jj

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Jujutsu (jj) Version Control

Jujutsu(jj)版本控制

Agent Usage

Agent使用说明

When reading data from jj, always use
--ignore-working-copy
to avoid snapshotting the working copy (which is slow and unnecessary for read operations).
从jj读取数据时,请始终使用
--ignore-working-copy
参数,避免对工作副本生成快照(这一操作速度慢且对读取操作毫无必要)。

Non-interactive Commands (Critical)

非交互式命令(重点)

Many jj commands spawn
$EDITOR
or interactive diff tools by default. These will hang indefinitely when run by agents. Always use the non-interactive alternatives:
CommandProblemSolution
jj describe
Opens editorAlways use
-m "message"
jj commit
Opens editorAlways use
-m "message"
jj split
Opens diff editor + may open editor for descriptionProvide filesets to select files; use
-m
for description
jj squash
May open editor for combined descriptionUse
-m "message"
or
-u
(use destination message)
Commands to avoid entirely (no non-interactive mode):
  • jj diffedit
    — use
    jj restore
    or edit files directly instead
  • jj config edit
    — use
    jj config set <key> <value>
    instead
  • jj sparse edit
    — use
    jj sparse set --add <path>
    or
    --remove <path>
    instead
  • jj resolve
    — edit conflict markers directly in files, or use
    --tool :ours
    /
    --tool :theirs
许多jj命令默认会启动
$EDITOR
或交互式差异工具。**当由Agent执行时,这些命令会无限挂起。**请务必使用非交互式替代方案:
命令问题解决方案
jj describe
打开编辑器始终使用
-m "message"
参数
jj commit
打开编辑器始终使用
-m "message"
参数
jj split
打开差异编辑器+可能打开编辑器编写描述指定文件集来选择文件;使用
-m
参数设置描述
jj squash
可能打开编辑器编写合并后的描述使用
-m "message"
参数或
-u
参数(使用目标提交的描述)
完全需要避免的命令(无交互式模式):
  • jj diffedit
    — 改用
    jj restore
    或直接编辑文件
  • jj config edit
    — 改用
    jj config set <key> <value>
  • jj sparse edit
    — 改用
    jj sparse set --add <path>
    --remove <path>
  • jj resolve
    — 直接在文件中编辑冲突标记,或使用
    --tool :ours
    /
    --tool :theirs
    参数

Agent-Friendly Output Formats

Agent友好的输出格式

jj's default diff and conflict formats differ from Git's. For easier parsing, use Git-compatible formats:
Diffs: Use the
--git
flag for unified diff output:
bash
jj diff --git
jj log -p --git
jj show --git
Conflicts: jj uses diff-based conflict markers by default (
%%%%%%%
,
+++++++
). For standard Git-style markers (
<<<<<<<
,
=======
,
>>>>>>>
), pass
--config
when running commands that may create conflicts:
bash
jj --config ui.conflict-marker-style=git rebase ...
jj --config ui.conflict-marker-style=git new --insert-before ...
The conflict style is applied when conflicts are materialized to the working copy, so the config must be set before the conflict occurs.
JSON: For structured/programmatic output, use the
json(self)
template:
bash
jj log --ignore-working-copy --no-graph -T 'json(self) ++ "\n"'
Outputs one JSON object per line with commit_id, change_id, description, author, etc. Works with
jj log
,
jj show
, and other commands that support
-T
.
jj默认的差异和冲突格式与Git不同。为便于解析,请使用Git兼容格式:
差异输出: 使用
--git
参数获取统一差异输出:
bash
jj diff --git
jj log -p --git
jj show --git
冲突标记: jj默认使用基于差异的冲突标记(
%%%%%%%
,
+++++++
)。如需使用标准Git风格的标记(
<<<<<<<
,
=======
,
>>>>>>>
),请在运行可能产生冲突的命令时传入
--config
参数:
bash
jj --config ui.conflict-marker-style=git rebase ...
jj --config ui.conflict-marker-style=git new --insert-before ...
冲突样式会在冲突被具体化到工作副本时生效,因此必须在冲突发生设置该配置。
JSON格式: 如需结构化/程序化输出,请使用
json(self)
模板:
bash
jj log --ignore-working-copy --no-graph -T 'json(self) ++ "\n"'
每行输出一个JSON对象,包含commit_id、change_id、描述、作者等信息。适用于
jj log
jj show
及其他支持
-T
参数的命令。

Common Commands

常用命令

CommandDescription
jj status
Show working copy status
jj log
Show commit history
jj new
Create a new change
jj describe -m "msg"
Set commit message
jj squash
Squash into parent
jj diff
Show changes
jj git push
Push to remote
jj git fetch
Fetch from remote
jj bookmark create name
Create a bookmark
命令说明
jj status
显示工作副本状态
jj log
显示提交历史
jj new
创建新变更
jj describe -m "msg"
设置提交信息
jj squash
合并到父提交
jj diff
显示变更内容
jj git push
推送到远程仓库
jj git fetch
从远程仓库拉取
jj bookmark create name
创建书签

Topics

专题指南

In-depth guides on jj concepts and syntax.
  • Bookmarks
  • Config
  • Filesets
  • Glossary
  • Revsets
  • Templates
  • Tutorial
关于jj概念与语法的深度指南。
  • 书签
  • 配置
  • 文件集
  • 术语表
  • 版本集
  • 模板
  • 教程

Command Reference

命令参考

Documentation generated from jj manpages. For details on any command, read the corresponding reference file.
由jj手册页生成的文档。如需了解任意命令的详细信息,请阅读对应的参考文件。

Bisect

二分查找

  • jj-bisect-run
  • jj-bisect-run

Bookmark

书签

  • jj-bookmark-create
  • jj-bookmark-delete
  • jj-bookmark-forget
  • jj-bookmark-list
  • jj-bookmark-move
  • jj-bookmark-rename
  • jj-bookmark-set
  • jj-bookmark-track
  • jj-bookmark-untrack
  • jj-bookmark-create
  • jj-bookmark-delete
  • jj-bookmark-forget
  • jj-bookmark-list
  • jj-bookmark-move
  • jj-bookmark-rename
  • jj-bookmark-set
  • jj-bookmark-track
  • jj-bookmark-untrack

Config

配置

  • jj-config-edit
  • jj-config-get
  • jj-config-list
  • jj-config-path
  • jj-config-set
  • jj-config-unset
  • jj-config-edit
  • jj-config-get
  • jj-config-list
  • jj-config-path
  • jj-config-set
  • jj-config-unset

File

文件

  • jj-file-annotate
  • jj-file-chmod
  • jj-file-list
  • jj-file-search
  • jj-file-show
  • jj-file-track
  • jj-file-untrack
  • jj-file-annotate
  • jj-file-chmod
  • jj-file-list
  • jj-file-search
  • jj-file-show
  • jj-file-track
  • jj-file-untrack

General

通用命令

  • jj
  • jj-abandon
  • jj-absorb
  • jj-bisect
  • jj-bookmark
  • jj-commit
  • jj-config
  • jj-describe
  • jj-diff
  • jj-diffedit
  • jj-duplicate
  • jj-edit
  • jj-evolog
  • jj-file
  • jj-fix
  • jj-gerrit
  • jj-git
  • jj-help
  • jj-interdiff
  • jj-log
  • jj-metaedit
  • jj-new
  • jj-next
  • jj-operation
  • jj-parallelize
  • jj-prev
  • jj-rebase
  • jj-redo
  • jj-resolve
  • jj-restore
  • jj-revert
  • jj-root
  • jj-show
  • jj-sign
  • jj-sparse
  • jj-split
  • jj-squash
  • jj-status
  • jj-tag
  • jj-undo
  • jj-unsign
  • jj-util
  • jj-version
  • jj-workspace
  • jj
  • jj-abandon
  • jj-absorb
  • jj-bisect
  • jj-bookmark
  • jj-commit
  • jj-config
  • jj-describe
  • jj-diff
  • jj-diffedit
  • jj-duplicate
  • jj-edit
  • jj-evolog
  • jj-file
  • jj-fix
  • jj-gerrit
  • jj-git
  • jj-help
  • jj-interdiff
  • jj-log
  • jj-metaedit
  • jj-new
  • jj-next
  • jj-operation
  • jj-parallelize
  • jj-prev
  • jj-rebase
  • jj-redo
  • jj-resolve
  • jj-restore
  • jj-revert
  • jj-root
  • jj-show
  • jj-sign
  • jj-sparse
  • jj-split
  • jj-squash
  • jj-status
  • jj-tag
  • jj-undo
  • jj-unsign
  • jj-util
  • jj-version
  • jj-workspace

Gerrit

Gerrit集成

  • jj-gerrit-upload
  • jj-gerrit-upload

Git

Git集成

  • jj-git-clone
  • jj-git-colocation
  • jj-git-colocation-disable
  • jj-git-colocation-enable
  • jj-git-colocation-status
  • jj-git-export
  • jj-git-fetch
  • jj-git-import
  • jj-git-init
  • jj-git-push
  • jj-git-remote
  • jj-git-remote-add
  • jj-git-remote-list
  • jj-git-remote-remove
  • jj-git-remote-rename
  • jj-git-remote-set-url
  • jj-git-root
  • jj-git-clone
  • jj-git-colocation
  • jj-git-colocation-disable
  • jj-git-colocation-enable
  • jj-git-colocation-status
  • jj-git-export
  • jj-git-fetch
  • jj-git-import
  • jj-git-init
  • jj-git-push
  • jj-git-remote
  • jj-git-remote-add
  • jj-git-remote-list
  • jj-git-remote-remove
  • jj-git-remote-rename
  • jj-git-remote-set-url
  • jj-git-root

Operation

操作管理

  • jj-operation-abandon
  • jj-operation-diff
  • jj-operation-log
  • jj-operation-restore
  • jj-operation-revert
  • jj-operation-show
  • jj-operation-abandon
  • jj-operation-diff
  • jj-operation-log
  • jj-operation-restore
  • jj-operation-revert
  • jj-operation-show

Simplify

简化操作

  • jj-simplify-parents
  • jj-simplify-parents

Sparse

稀疏检出

  • jj-sparse-edit
  • jj-sparse-list
  • jj-sparse-reset
  • jj-sparse-set
  • jj-sparse-edit
  • jj-sparse-list
  • jj-sparse-reset
  • jj-sparse-set

Tag

标签

  • jj-tag-delete
  • jj-tag-list
  • jj-tag-set
  • jj-tag-delete
  • jj-tag-list
  • jj-tag-set

Util

工具类

  • jj-util-completion
  • jj-util-config-schema
  • jj-util-exec
  • jj-util-gc
  • jj-util-install-man-pages
  • jj-util-markdown-help
  • jj-util-completion
  • jj-util-config-schema
  • jj-util-exec
  • jj-util-gc
  • jj-util-install-man-pages
  • jj-util-markdown-help

Workspace

工作区管理

  • jj-workspace-add
  • jj-workspace-forget
  • jj-workspace-list
  • jj-workspace-rename
  • jj-workspace-root
  • jj-workspace-update-stale

Generated from jj manpages (jj 0.37.0)
  • jj-workspace-add
  • jj-workspace-forget
  • jj-workspace-list
  • jj-workspace-rename
  • jj-workspace-root
  • jj-workspace-update-stale

由jj手册页生成(jj 0.37.0)

License

许可证

The content in the
references/
directory is derived from the jj (Jujutsu) project and is licensed under the Apache License 2.0.
references/
目录中的内容源自jj(Jujutsu)项目,采用Apache License 2.0许可证。