jujutsu
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseJujutsu
Jujutsu
Git-compatible VCS focused on concurrent development and ease of use.
与Git兼容的版本控制系统,专注于并行开发和易用性。
Key Commands
核心命令
| Command | Description |
|---|---|
| Show working copy status |
| Show change log |
| Show changes in working copy |
| Create new change |
| Edit change description |
| Move changes to parent |
| Split current change |
| Rebase changes |
| Move changes into stack of mutable revisions |
| Find bad revision by bisection |
| Update files with formatting fixes |
| Cryptographically sign a revision |
| Modify metadata without changing content |
| 命令 | 描述 |
|---|---|
| 显示工作副本状态 |
| 显示变更日志 |
| 显示工作副本中的变更 |
| 创建新变更 |
| 编辑变更描述 |
| 将变更合并至父提交 |
| 拆分当前变更 |
| 变基变更 |
| 将变更移入可变修订的堆栈中 |
| 通过二分查找定位有问题的修订 |
| 用格式修复更新文件 |
| 对修订进行加密签名 |
| 修改元数据而不改变内容 |
Project Setup
项目设置
bash
jj git init # Init in existing git repo
jj git init --colocate # Side-by-side with gitbash
jj git init # 在现有Git仓库中初始化
jj git init --colocate # 与Git并排使用Basic Workflow
基础工作流
bash
jj new # Create new change
jj desc -m "feat: add feature" # Set description
jj log # View history
jj edit change-id # Switch to change
jj new --before @ # Time travel (create before current)
jj edit @- # Go to parentbash
jj new # 创建新变更
jj desc -m "feat: add feature" # 设置描述
jj log # 查看历史
jj edit change-id # 切换至指定变更
jj new --before @ # 时间回溯(在当前变更前创建新变更)
jj edit @- # 切换至父变更Time Travel
时间回溯
bash
jj edit change-id # Switch to specific change
jj next --edit # Next child change
jj edit @- # Parent change
jj new --before @ -m msg # Insert before currentbash
jj edit change-id # 切换至指定变更
jj next --edit # 切换至下一个子变更
jj edit @- # 切换至父变更
jj new --before @ -m msg # 在当前变更前插入新变更Merging & Rebasing
合并与变基
bash
jj new x yz -m msg # Merge changes
jj rebase -s src -d dest # Rebase source onto dest
jj abandon # Delete current changebash
jj new x yz -m msg # 合并变更
jj rebase -s src -d dest # 将源变更变基至目标变更
jj abandon # 删除当前变更Conflicts
冲突处理
bash
jj resolve # Interactive conflict resolutionbash
jj resolve # 交互式冲突解决Edit files, then continue
编辑文件后继续操作
undefinedundefinedTemplates & Revsets
模板与修订集
bash
jj log -T 'commit_id ++ "\n" ++ description'
jj log -r 'heads(all())' # All heads
jj log -r 'remote_bookmarks()..' # Not on remote
jj log -r 'author(name)' # By authorbash
jj log -T 'commit_id ++ "\n" ++ description'
jj log -r 'heads(all())' # 查看所有分支头
jj log -r 'remote_bookmarks()..' # 查看未推送到远程的变更
jj log -r 'author(name)' # 按作者筛选变更Git Interop
Git互操作
bash
jj bookmark create main -r @ # Create bookmark
jj git push --bookmark main # Push bookmark
jj git fetch # Fetch from remote
jj bookmark track main@origin # Track remotebash
jj bookmark create main -r @ # 创建书签
jj git push --bookmark main # 推送书签
jj git fetch # 从远程拉取
jj bookmark track main@origin # 追踪远程书签Advanced Commands
高级命令
bash
jj absorb # Auto-move changes to relevant commits in stack
jj bisect start # Start bisection
jj bisect good # Mark current as good
jj bisect bad # Mark current as bad
jj fix # Run configured formatters on files
jj sign -r @ # Sign current revision
jj metaedit -r @ -m "new message" # Edit metadata onlybash
jj absorb # 自动将变更移入堆栈中相关的提交
jj bisect start # 开始二分查找
jj bisect good # 将当前标记为正常
jj bisect bad # 将当前标记为异常
jj fix # 对文件运行配置的格式化工具
jj sign -r @ # 对当前修订签名
jj metaedit -r @ -m "new message" # 仅编辑元数据Tips
小贴士
- No staging: changes are immediate
- Use conventional commits:
type(scope): desc - to revert operations
jj undo - to see operation history
jj op log - Bookmarks are like branches
- is powerful for fixing up commits in a stack
jj absorb
- 无暂存区:变更即时生效
- 使用规范提交格式:
type(scope): desc - 使用撤销操作
jj undo - 使用查看操作历史
jj op log - 书签功能类似分支
- 在修复堆栈中的提交时非常实用
jj absorb
Related Skills
相关技能
- gh: GitHub CLI for PRs and issues
- review: Code review before committing
- gh: 用于PR和议题的GitHub CLI
- review: 提交前的代码审查