| name | jujutsu |
| description | Manages version control with Jujutsu (jj), including rebasing, conflict resolution, and Git interop. Use when tracking changes, navigating history, squashing/splitting commits, or pushing to Git remotes. |
Jujutsu
Git-compatible VCS with a different data model — no staging area, changes are immediate. Every file is tracked in the working copy as "changes" (like commits without parents).
⚠️ Never use git for mutations in a jj repo — it corrupts history. Allowed: git log, git diff, git show, git blame, git grep.
Basic Workflow
Create a change, describe it, view history:
jj new
jj desc -m "feat: add login"
jj log
jj diff
Edit an existing change:
jj edit <change-id>
jj squash
Time Travel & Navigation
Jump to any point in history:
jj edit @-
jj next --edit
jj edit <change-id>
jj new --before @
Squash & Split Changes
Combine changes into one:
jj squash -m "combined message"
jj split
Auto-move changes to relevant commits in a stack:
jj absorb
Rebasing & Merging
Rebase changes onto another:
jj rebase -s @- -d main
jj rebase -d main -s ::@
Merge two changes:
jj new x yz -m "merge"
Conflicts
Resolve interactively:
jj resolve
Pushing to Git
Bookmarks are like branches. Track and push them:
jj bookmark create main -r @
jj git push --bookmark main
jj git fetch
jj bookmark track main@origin
Useful Patterns
Undo an operation: jj undo — reverses the last jj command.
Get git commit hash from jj change:
jj log -T 'commit_id\n' -r @
jj log -T 'commit_id.short()\n' -r @
git rev-parse @
Operation history: jj op log — see all jj operations.
Common Pitfalls
- ❌ Use
@~1 → ✅ Use @- (parent)
- ❌ Use
a,b,c for union → ✅ Use a | b | c (pipe, not comma)
- ❌ Use
jj changes → ✅ Use jj log or jj diff
Related Skills
- conventional-commits: Commit message format
- sem: Semantic analysis before writing commit messages