Loading...
Loading...
Compare original and translation side by side
⚠️ Never usefor mutations in a jj repo — it corrupts history. Allowed:git,git log,git diff,git show,git blame.git grep
⚠️ 切勿在jj仓库中使用执行变更操作——这会破坏历史记录。允许使用的命令:git、git log、git diff、git show、git blame。git grep
jj new # Start a new change (like working on a commit)
jj desc -m "feat: add login" # Write the message
jj log # View history — this is your main view command
jj diff # See what changed in working copyjj edit <change-id> # Switch to a specific changejj new # 启动一个新变更(类似开发一个提交)
jj desc -m "feat: add login" # 编写提交信息
jj log # 查看历史——这是你的核心查看命令
jj diff # 查看工作副本中的变更jj edit <change-id> # 切换到指定变更undefinedundefinedjj edit @- # Go to parent
jj next --edit # Go to child
jj edit <change-id> # Jump to specific change
jj new --before @ # Insert a new change before currentjj edit @- # 回到父变更
jj next --edit # 切换到子变更
jj edit <change-id> # 跳转到指定变更
jj new --before @ # 在当前变更前插入新变更undefinedundefined
Auto-move changes to relevant commits in a stack:
```bash
jj absorb # Smart squashing across mutable revisions
自动将变更移动到栈中对应的提交:
```bash
jj absorb # 在可变版本间智能压缩变更jj rebase -s @- -d main # Rebase current change onto main
jj rebase -d main -s ::@ # Rebase all descendants of @ onto mainjj new x yz -m "merge" # Create merge of x and yzjj rebase -s @- -d main # 将当前变更变基到main分支
jj rebase -d main -s ::@ # 将当前变更的所有后代变基到main分支jj new x yz -m "merge" # 创建x和yz的合并变更undefinedundefinedundefinedundefinedjj bookmark create main -r @ # Create a bookmark at current change
jj git push --bookmark main # Push that bookmark
jj git fetch # Fetch from remote
jj bookmark track main@origin # Track a remote bookmarkjj bookmark create main -r @ # 在当前变更处创建书签
jj git push --bookmark main # 推送该书签
jj git fetch # 从远程仓库拉取
jj bookmark track main@origin # 跟踪远程书签jj undojj log -T 'commit_id\n' -r @ # Full hash
jj log -T 'commit_id.short()\n' -r @ # Short hash
git rev-parse @ # Also works in colocated reposjj op logjj undojj log -T 'commit_id\n' -r @ # 完整哈希
jj log -T 'commit_id.short()\n' -r @ # 短哈希
git rev-parse @ # 在共存仓库中同样生效jj op log-T--template-T--templateconcat()undefinedconcat()undefined
**Common fields:** `change_id`, `commit_id`, `description`, `author`, `committer`, `signature`
**Field name is `description`, NOT `desc`:**
```bash
**常用字段:** `change_id`、`commit_id`、`description`、`author`、`committer`、`signature`
**字段名为`description`,而非`desc`:**
```bash
**Double quotes for pipe alternation in bash:**
```bash
**bash中管道交替需使用双引号:**
```bash
**After `jj desc`, the working copy (`@`) moves:**
```bash
**执行`jj desc`后,工作副本(`@`)会移动:**
```bashundefinedundefined@~1@-a,b,ca | b | cjj changesjj logjj diffconcat(a, b)descdescription@jj desc@~1@-a,b,ca | b | cjj changesjj logjj diffconcat(a, b)descdescriptionjj desc@