jujutsu
Original:🇺🇸 English
Translated
This skill should be used when the user mentions Jujutsu version control, "jj" commands, working with jj repositories, or asks about Git to Jujutsu equivalents. Triggers on keywords like "jujutsu", "jj", "jj-vcs", "jj repo", "jj commit", "jj log", "jj new", "jj squash", "jj rebase", "jj bookmark", or questions about Jujutsu workflows and concepts.
1installs
Sourceahmedelgabri/dotfiles
Added on
NPX Install
npx skill4agent add ahmedelgabri/dotfiles jujutsuTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Jujutsu (jj) Version Control Skill
This skill enables working with Jujutsu, a Git-compatible version control system
with a fundamentally different model. Jujutsu treats the working copy as a
commit, has no staging area, and uses change IDs for stable references across
rewrites.
Core Concepts
Working Copy as a Commit
Unlike Git, the working copy IS a commit. Changes are automatically snapshotted
when running commands - no explicit or staging required.
jjaddChange IDs vs Commit IDs
Every commit has two identifiers:
- Change ID: Stable across rewrites (e.g., )
kkmpptxz - Commit ID: Hash-based, changes on rewrite (e.g., )
abc123def
Use change IDs for references that survive rebases.
Revsets
Revsets are expressions to select commits:
- - Working copy commit
@ - - Parent of working copy
@- - - Repository root
root() - - All bookmarked commits
bookmarks() - - Commits from foo to bar (exclusive)
foo..bar - - Commits from foo to bar (inclusive)
foo::bar - - Union
A | B - - Intersection
A & B - - Complement
~A
Bookmarks (not Branches)
Bookmarks are named pointers that map to Git branches. They move automatically
when commits are rewritten.
Quick Reference
| Git Command | Jujutsu Equivalent | Notes |
|---|---|---|
| | Use |
| | Git repos only |
| | Shows working copy diff |
| | Diff of working copy |
| N/A | No staging area |
| | Auto-includes all changes |
| | Squash into parent |
| | Visual commit graph |
| | Show revision details |
| | Start new change |
| | Edit existing change |
| | Discard working copy |
| | Just start new change |
| | Rebase A onto B |
| | Copy commits |
| | Creates merge commit |
| | Fetch from remote |
| | Push bookmarks |
| | Create bookmark |
Common Workflows
Starting Work
bash
# Clone a repo
jj git clone https://github.com/owner/repo
# Or init in existing directory
jj git init --colocate
# Create new change from main
jj new main
# Work on files (no add needed)
# Edit files...
# Describe the change
jj describe -m "feat: add new feature"
# Finish and start next change
jj newViewing State
bash
# Show log with graph
jj log
# Show working copy diff
jj diff
# Show specific revision
jj show @-
# Status of working copy
jj st
# Show file at revision
jj file show path/to/file -r REVModifying History
bash
# Squash working copy into parent
jj squash
# Squash specific change into parent
jj squash -r CHANGE
# Interactive squash (select hunks)
jj squash -i
# Split a commit
jj split
# Edit a commit message
jj describe -r REV -m "new message"
# Edit an older commit
jj edit CHANGE
# Make changes...
jj new # Return to tipRebasing
bash
# Rebase current change onto main
jj rebase -d main
# Rebase branch onto main
jj rebase -b BRANCH -d main
# Rebase revision and descendants
jj rebase -r REV -d DEST
# Rebase source and descendants
jj rebase -s SOURCE -d DESTBookmarks and Remotes
bash
# Create bookmark at current change
jj bookmark create NAME
# Create bookmark at specific revision
jj bookmark create NAME -r REV
# Move bookmark
jj bookmark move NAME -r REV
# List bookmarks
jj bookmark list
# Track remote bookmark
jj bookmark track NAME@origin
# Push bookmark to remote
jj git push --bookmark NAME
# Push all bookmarks
jj git push --all
# Fetch from remote
jj git fetchWorking with GitHub
bash
# Create PR branch
jj new main
# Work...
jj describe -m "feat: my feature"
jj bookmark create my-feature
jj git push --bookmark my-feature
# Update PR after review
jj edit my-feature
# Make changes...
jj git push --bookmark my-feature
# After merge, clean up
jj git fetch
jj bookmark delete my-featureConflict Resolution
Conflicts in Jujutsu don't block rebases - they're recorded in commits.
bash
# Check for conflicts
jj log # Conflicted commits shown with marker
# Resolve conflicts
jj new CONFLICTED_CHANGE
# Edit conflict markers in files
jj squash # Squash resolution into conflicted change
# Or use resolve command
jj resolveUndo Operations
bash
# View operation log
jj op log
# Undo last operation
jj undo
# Restore to specific operation
jj op restore OP_IDKey Differences from Git
- No staging area: All file changes automatically included
- Working copy is a commit: Always have a "draft" commit
- Conflicts don't block: Rebases complete, conflicts recorded
- Change IDs: Stable references across history rewrites
- Operation log: Full undo capability for any operation
- Automatic snapshot: No risk of losing uncommitted work
Colocated vs Non-colocated
Colocated ():
jj git init --colocate- and
.gitin same directory.jj - Can use Git tools alongside jj
- Git sees jj commits
Non-colocated ():
jj git init- Only directory
.jj - Pure jj workflow
- Use to sync to Git
jj git export
Additional Resources
Reference Files
For detailed command reference and advanced workflows:
- - Complete Git to Jujutsu command mapping
references/git-command-table.md - - Revset syntax and examples
references/revsets.md
External Documentation
- Official docs: https://docs.jj-vcs.dev/latest/
- Tutorial: https://docs.jj-vcs.dev/latest/tutorial/
- GitHub workflow: https://docs.jj-vcs.dev/latest/github/