jj
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseJujutsu (jj) Version Control
Jujutsu(jj)版本控制
Agent Usage
Agent使用说明
When reading data from jj, always use to avoid snapshotting the working copy (which is slow and unnecessary for read operations).
--ignore-working-copy从jj读取数据时,请始终使用参数,避免对工作副本生成快照(这一操作速度慢且对读取操作毫无必要)。
--ignore-working-copyNon-interactive Commands (Critical)
非交互式命令(重点)
Many jj commands spawn or interactive diff tools by default. These will hang indefinitely when run by agents. Always use the non-interactive alternatives:
$EDITOR| Command | Problem | Solution |
|---|---|---|
| Opens editor | Always use |
| Opens editor | Always use |
| Opens diff editor + may open editor for description | Provide filesets to select files; use |
| May open editor for combined description | Use |
Commands to avoid entirely (no non-interactive mode):
- — use
jj diffeditor edit files directly insteadjj restore - — use
jj config editinsteadjj config set <key> <value> - — use
jj sparse editorjj sparse set --add <path>instead--remove <path> - — edit conflict markers directly in files, or use
jj resolve/--tool :ours--tool :theirs
许多jj命令默认会启动或交互式差异工具。**当由Agent执行时,这些命令会无限挂起。**请务必使用非交互式替代方案:
$EDITOR| 命令 | 问题 | 解决方案 |
|---|---|---|
| 打开编辑器 | 始终使用 |
| 打开编辑器 | 始终使用 |
| 打开差异编辑器+可能打开编辑器编写描述 | 指定文件集来选择文件;使用 |
| 可能打开编辑器编写合并后的描述 | 使用 |
完全需要避免的命令(无交互式模式):
- — 改用
jj diffedit或直接编辑文件jj restore - — 改用
jj config editjj 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 flag for unified diff output:
--gitbash
jj diff --git
jj log -p --git
jj show --gitConflicts: jj uses diff-based conflict markers by default (, ). For standard Git-style markers (, , ), pass when running commands that may create conflicts:
%%%%%%%+++++++<<<<<<<=======>>>>>>>--configbash
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 template:
json(self)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 , , and other commands that support .
jj logjj show-Tjj默认的差异和冲突格式与Git不同。为便于解析,请使用Git兼容格式:
差异输出: 使用参数获取统一差异输出:
--gitbash
jj diff --git
jj log -p --git
jj show --git冲突标记: jj默认使用基于差异的冲突标记(, )。如需使用标准Git风格的标记(, , ),请在运行可能产生冲突的命令时传入参数:
%%%%%%%+++++++<<<<<<<=======>>>>>>>--configbash
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 logjj show-TCommon Commands
常用命令
| Command | Description |
|---|---|
| Show working copy status |
| Show commit history |
| Create a new change |
| Set commit message |
| Squash into parent |
| Show changes |
| Push to remote |
| Fetch from remote |
| Create a bookmark |
| 命令 | 说明 |
|---|---|
| 显示工作副本状态 |
| 显示提交历史 |
| 创建新变更 |
| 设置提交信息 |
| 合并到父提交 |
| 显示变更内容 |
| 推送到远程仓库 |
| 从远程仓库拉取 |
| 创建书签 |
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 directory is derived from the jj (Jujutsu) project and is licensed under the Apache License 2.0.
references/