jj

felixge's avatarfrom felixge

Use the jj version control system. Always use it when the user mentions jj.

⭐30stars🔀3forks📁View on GitHub🕐Updated Dec 29, 2025

When & Why to Use This Skill

This Claude skill integrates the Jujutsu (jj) version control system, a modern and powerful alternative to Git. It enables users to manage code revisions, perform complex history manipulations like rebasing and squashing, and handle Git-compatible workflows with a simplified 'no-staging-area' approach. By bringing jj's advanced conflict resolution and undo capabilities into the AI environment, it streamlines the software development lifecycle.

Use Cases

  • 1. Simplified Version Control: Manage code changes efficiently using jj's unique model where the working copy is automatically the current revision, eliminating the need for a staging area.
  • 2. Advanced History Refactoring: Clean up and organize commit history using powerful commands like squash, split, and rebase to ensure a professional project log.
  • 3. Seamless Git Integration: Work within existing Git repositories while utilizing jj's superior interface for fetching, pushing, and managing bookmarks (branches).
  • 4. Safe Experimentation and Recovery: Use the 'jj undo' feature and mutable changes to experiment with code safely, with the ability to revert any command instantly.
namejj
descriptionUse the jj version control system. Always use it when the user mentions jj.

jj

Common Commands Cheat Sheet

Basic Operations

  • jj status - Show current status
  • jj log - Show commit history
  • jj diff - Show changes in current revision (@)
  • jj diff --git - Show changes in git format
  • jj show - View changes in current revision (same as diff)

Making Changes

  • jj desc -m "msg" - Add description to current change
  • jj commit -m "msg" - Add description and start a new change
  • jj new - Finalize current change and start a new one
  • jj new -r main - Start a new change from main
  • jj squash - Combine changes with parent
  • jj squash -i - Interactive squash (select specific changes)
  • jj split - Split current change into multiple parts
  • jj abandon - Discard current change
  • jj edit <change-id> - Switch to and edit a specific change
  • jj edit @- - Move to previous change
  • jj next --edit - Move to next change

Branches (Bookmarks)

  • jj bookmark create <name> / jj b c <name> - Create bookmark at current revision
  • jj b c -r@ <name> - Create bookmark at @ (current revision)

Rebasing & Merging

  • jj rebase -b@ -dmain - Rebase current branch onto main
  • jj rebase -s <source> -d <dest> - Rebase source onto destination
  • jj new <change1> <change2> -m "msg" - Merge multiple changes

Git Integration

  • jj git init - Initialize jj repository with git backend
  • jj git fetch - Fetch from remote (updates tracked bookmarks)
  • jj git push - Push bookmarks to remote
  • jj git push --allow-new - Push including new bookmarks

Utilities

  • jj undo - Undo last jj command
  • jj restore <file> - Restore file from a revision
  • jj resolve - Open conflict resolution UI
  • jj file annotate <file> - Show file annotation (like git blame)

Key Concepts

  • @ = the working copy (current revision)
  • No staging area - all changes are automatically in @
  • Changes are mutable until pushed
  • Bookmarks = Git branches

Advanced

To understand the syntax of the jj revset language (-r flag), use the following command: jj help -k revsets