| name | jj |
| description | Jujutsu VCS workflows and custom aliases. Use when working with jj commands, commits, revsets, or version control operations. |
| user-invocable | false |
Jujutsu (jj) Version Control
Uses Jujutsu (jj) for version control with git backend. Key differences from git:
- No staging area - changes are automatically tracked
- Commits are mutable by default
- Working copy is always a commit (
@)
- Branches are optional "bookmarks"
Signing Policy (Mandatory)
- Commit signing is required for pushable changes in this environment.
- Never bypass signing by overriding config at command time (for example
--config git.sign-on-push=false or similar).
- Never modify repo/user config to disable push signing.
- If signing fails (for example 1Password/SSH agent issues), stop and ask the user to fix or approve the next step; do not push unsigned as a workaround.
Core Concepts
@ - The working copy commit (always exists)
@- - Parent of working copy (very commonly used)
trunk() - The main branch (usually main or master)
immutable() - Commits that shouldn't be modified
- Revisions use short change IDs (e.g.,
xy, zk, trunk())
Most Used Commands
Status & Viewing (daily drivers)
jj st
jj diff
jj log
jj show
jj show -r @-
Creating & Modifying Commits
jj new
jj new <rev>
jj new --insert-after <rev>
jj commit -m "msg"
jj commit <paths>
jj describe
jj describe -r <rev>
jj edit <rev>
Fixing Earlier Stack Commits
When fixing an earlier commit in a stack, prefer a temporary fixup commit over directly editing the target commit. This keeps the new delta easy to inspect with jj diff, while still letting later commits see the fix during verification.
jj new --insert-after <target-rev>
jj diff
mise run pre-commit
jj squash
jj new --insert-after <target-rev> creates a new change immediately after the target commit and rebases the target's descendants on top of it. After verification, plain jj squash folds the current fixup commit into its parent, which is the target commit.
Use jj new <target-rev> when you only need a sibling fixup to inspect and squash locally. Use --insert-after when descendants should be tested with the fix before squashing. Reserve jj edit <rev> for inspection, intentionally continuing work in the current commit, or explicit direct mutation.
Squashing & Combining
jj sq
jj sq -r @-
jj sq -r @- --use-destination-message
jj squash -r <rev> --into <target>
jj squash <paths>
Reordering & Rebasing
jj rebase -r <rev> -d trunk()
jj rebase -s <rev> -d trunk()
jj rebase -r <rev> --insert-after <x>
jj rebase -r <rev> --insert-before <x>
jj up
Restoring & Undoing
jj restore
jj restore <paths>
jj restore --from <rev>
jj restore --from <rev> <paths>
jj abandon <rev>
jj undo
jj op log
Git Integration
jj git fetch
jj git push
jj git push --named <branch>=<rev>
jj git push -b <name>
jj git init --colocate
Bookmark Management
jj bookmark track <name>@origin
jj bookmark list
jj tug
File Tracking
jj file untrack <paths>
jj file list
Custom Aliases (from config)
Viewing History
jj open
jj ropen
jj recent
Branch Operations
jj up
jj tug
jj branch-diff
jj branch-diff-files
jj stack-diff
jj stack-diff-files
Pre-commit Integration
jj pre-commit-last
jj pre-commit-branch
jj pre-commit-stack
Private Commit Operations
jj rebase-private
Custom Revset Aliases
branch()
stack()
open()
private()
slice()
slice(from)
stack_context()
stack_context(from)
closest_bookmark(to)
closest_pushable(to)
last()
last(n)
ropen()
Private Commits
Prefix with private: to prevent pushing:
jj commit -m "private: WIP debugging"
jj rebase-private
Configuration Notes
- Colocated repos:
git.colocate = true -- all repos are colocated, git commands work alongside jj
- Signing:
behavior = "drop" locally (commits may be unsigned), but sign-on-push = true signs commits when pushed via 1Password SSH agent. Do not disable this for pushes.
- Auto push bookmark: Creates
rwjblue/push-<change_id> on push when no bookmark exists
- Fetch from all remotes:
git.fetch = ["glob:*"] -- handles fork workflows where origin and upstream both exist
- Delta pager: Used only for
jj diff (scoped config), not for other commands to avoid terminal clearing
- Scoped config: Different email/signing key for work repos vs personal repos