working-with-jj
Jujutsu (jj) version control cheatsheet - viewing history, making commits, diffs, and descriptions
What this skill does
# Working with Jujutsu (jj) 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. ## Detecting Jujutsu Check if the project uses jj: ```bash test -d .jj && echo "jj" || echo "not jj" ``` ## Key Concepts - **`@`** - Your current working copy (like Git's HEAD) - **`@-`** - Parent of working copy (like Git's HEAD~1) - **No staging area** - Changes are automatically recorded - **Change IDs** - Stable identifiers that survive rebases - **Commit IDs** - Traditional hashes compatible with Git ## Recommended Workflow **The jj way:** 1. Make edits to files 2. Run `jj new` to create a new commit (repeat for every logical change) 3. After a series of commits, go back and review with `jj log` 4. Add meaningful descriptions with `jj describe <change-id> -m "description"` 5. Squash related commits together with `jj squash` This workflow creates fine-grained history as you work, then lets you organize it meaningfully afterward. ## Viewing the Log **Show recent commits:** ```bash jj log -r @~10..@ ``` **Show full log:** ```bash jj log ``` **Show specific commit:** ```bash jj show <change-id> ``` **Show log with more detail:** ```bash jj log --stat ``` ## Viewing Diffs **See current changes:** ```bash jj diff ``` **Diff specific commit:** ```bash jj diff -r <change-id> ``` **Diff between two commits:** ```bash jj diff --from <base> --to <head> ``` **Git-style diff output:** ```bash jj diff --git ``` **Show what changed in a commit:** ```bash jj show <change-id> ``` ## Getting Commit References **Current commit ID:** ```bash jj log -r @ -T commit_id --no-graph ``` **Parent commit ID:** ```bash jj log -r @- -T commit_id --no-graph ``` **Get change ID:** ```bash jj log -r @ -T change_id --no-graph ``` **Revset references:** - `@` - working copy commit - `@-` - parent commit - `@--` - grandparent commit - `root()` - the root commit - `trunk()` - main branch tip ## Making Commits **Create new commit (after editing files):** ```bash jj new ``` **Create new commit with message:** ```bash jj new -m "commit message" ``` **Commit current changes with description:** ```bash jj describe -m "commit message" jj new ``` **Note:** Unlike Git, jj automatically tracks file changes. No `add` command needed! ## Setting Descriptions **Set description for current commit:** ```bash jj describe -m "new description" ``` **Set description in editor:** ```bash jj describe ``` **Set description for specific commit:** ```bash jj describe <change-id> -m "description" ``` ## Organizing Commits **Squash current commit into parent:** ```bash jj squash ``` **Squash specific commit into its parent:** ```bash jj squash -r <change-id> ``` **Squash current commit into a specific commit:** ```bash jj squash --into <target-change-id> ``` **Move changes from one commit to another:** ```bash jj move --from <source> --to <target> ``` **Edit an earlier commit:** ```bash jj edit <change-id> ``` (Make changes, then `jj new` to continue) **Split a commit into multiple:** ```bash jj split <change-id> ``` ## Status Information **See current status:** ```bash jj status ``` **See bookmark (branch) info:** ```bash jj bookmark list ``` ## Common Patterns **Get range for code review:** ```bash 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:** ```bash jj diff --from trunk() --to @ ``` **See files changed:** ```bash jj diff --summary ``` ## Git Interoperability **Fetch from Git remote:** ```bash jj git fetch ``` **Push to Git remote:** ```bash jj git push ``` **Export to colocated Git repo:** ```bash jj git export ``` ## Workflow Comparison | 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! | ## Why Jujutsu? - **No staging area confusion** - Edit files, they're tracked - **No detached HEAD** - All commits are reachable - **Conflict tracking** - Conflicts are first-class objects - **Safe experimentation** - Easy to undo anything - **Git compatible** - Works with GitHub, GitLab, etc.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.