Jujutsu (jj) version control cheatsheet - viewing history, making commits, diffs, and descriptions
/plugin marketplace add williballenthin/aiwilli/plugin install wb@williballenthinThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Quick reference for common Jujutsu operations used in development workflows.
Jujutsu is a Git-compatible VCS that eliminates staging and treats your working directory as an actual commit that continuously updates.
Check if the project uses jj:
test -d .jj && echo "jj" || echo "not jj"
@ - Your current working copy (like Git's HEAD)@- - Parent of working copy (like Git's HEAD~1)The jj way:
jj new to create a new commit (repeat for every logical change)jj logjj describe <change-id> -m "description"jj squashThis workflow creates fine-grained history as you work, then lets you organize it meaningfully afterward.
Show recent commits:
jj log -r @~10..@
Show full log:
jj log
Show specific commit:
jj show <change-id>
Show log with more detail:
jj log --stat
See current changes:
jj diff
Diff specific commit:
jj diff -r <change-id>
Diff between two commits:
jj diff --from <base> --to <head>
Git-style diff output:
jj diff --git
Show what changed in a commit:
jj show <change-id>
Current commit ID:
jj log -r @ -T commit_id --no-graph
Parent commit ID:
jj log -r @- -T commit_id --no-graph
Get change ID:
jj log -r @ -T change_id --no-graph
Revset references:
@ - working copy commit@- - parent commit@-- - grandparent commitroot() - the root committrunk() - main branch tipCreate new commit (after editing files):
jj new
Create new commit with message:
jj new -m "commit message"
Commit current changes with description:
jj describe -m "commit message"
jj new
Note: Unlike Git, jj automatically tracks file changes. No add command needed!
Set description for current commit:
jj describe -m "new description"
Set description in editor:
jj describe
Set description for specific commit:
jj describe <change-id> -m "description"
Squash current commit into parent:
jj squash
Squash specific commit into its parent:
jj squash -r <change-id>
Squash current commit into a specific commit:
jj squash --into <target-change-id>
Move changes from one commit to another:
jj move --from <source> --to <target>
Edit an earlier commit:
jj edit <change-id>
(Make changes, then jj new to continue)
Split a commit into multiple:
jj split <change-id>
See current status:
jj status
See bookmark (branch) info:
jj bookmark list
Get range for code review:
BASE_SHA=$(jj log -r @- -T commit_id --no-graph)
HEAD_SHA=$(jj log -r @ -T commit_id --no-graph)
echo "Reviewing: $BASE_SHA..$HEAD_SHA"
Compare against trunk:
jj diff --from trunk() --to @
See files changed:
jj diff --summary
Fetch from Git remote:
jj git fetch
Push to Git remote:
jj git push
Export to colocated Git repo:
jj git export
| Task | Git | Jujutsu |
|---|---|---|
| Make commit | git add . && git commit -m "msg" | jj describe -m "msg" && jj new |
| See changes | git diff | jj diff |
| View history | git log | jj log |
| Get current SHA | git rev-parse HEAD | jj log -r @ -T commit_id --no-graph |
| Amend commit | git commit --amend | jj describe (then jj new if done) |
| No staging | (N/A) | Automatic! |