AgentSkillsCN

jujutsu

Jujutsu (jj) 版本控制系统指南。在处理提交、分支、拉取请求、PR、版本控制、变基、推送,或用户提及 jj、Git 或版本控制操作时使用。

SKILL.md
--- frontmatter
name: jujutsu
description: Guide to Jujutsu (jj) version control system. Use when working with commits, branches, pull requests, PRs, version control, rebasing, pushing, or when the user mentions jj, git, or version control operations.

Jujutsu (jj) Version Control Guide

Jujutsu is a modern, Git-compatible version control system. This project uses jj colocated with git.

Non-Interactive Usage (for Agents)

When using jj in automated contexts (CI, scripts, agents), use these flags to prevent blocking:

FlagUse WithPurpose
--no-pagerlog, diff, show, op log, evologPrevents pager from opening
-m "message"commit, describe, newAvoids opening editor for message
--no-editVariousSkip editor prompts
--tool=:ours / --tool=:theirsresolveNon-interactive conflict resolution

Always use --no-pager for any command that displays output in agent/script contexts.

Global Config to Disable Pager

To permanently disable the pager (useful for CI/agent environments):

bash
jj config set --user ui.paginate never

Or add to your config file (~/.config/jj/config.toml):

toml
[ui]
paginate = "never"

Key Differences from Git

ConceptGitJujutsu
Staging areaExplicit git addNone - working copy IS a commit
BranchesNamed refsBookmarks (auto-follow rewrites)
StashSeparate stash stackNot needed - just use commits
Amendgit commit --amendJust edit files, or use jj squash
IdentityCommit ID onlyChange ID (stable) + Commit ID

Essential Commands

TaskCommand (use --no-pager for agents)
Statusjj status or jj st
Diffjj diff (or jj --no-pager diff)
Logjj log (or jj --no-pager log)
Commit & continuejj commit -m "message"
Update messagejj describe -m "message"
New empty commitjj new
Squash into parentjj squash
Undo last operationjj undo
Fetch from remotejj git fetch
Push to remotejj git push
Create & push bookmarkjj git push --named name=@
Push existing bookmarkjj git push --bookmark name

Working Copy Model

The working copy (@) is always a commit. File changes are automatically tracked - no staging required.

code
parent commit
    ↓
@ (working copy) ← your edits go here automatically

Quick Git-to-Jujutsu Translation

GitJujutsu
git statusjj st
git diffjj diff
git logjj log
git add . && git commit -m "msg"jj commit -m "msg"
git pushjj git push
git pulljj git fetch then jj rebase -d main@origin
git checkout -b branchjj new main then jj bookmark set branch
git branchjj bookmark list
git stashjj new (just start new commit)
git blamejj file annotate

Additional References