Jujutsu (jj) usage

Guides version control operations with Jujutsu (jj) in Carbon repository checkouts.

33.9k|1.7k|Updated Apr 27, 2020
One-click install
npx skills add https://github.com/carbon-language/carbon-lang --skill jujutsu-jj-usage
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Jujutsu (jj) usage
Source: https://github.com/carbon-language/carbon-lang/tree/main/.agents/skills/jj
Command: npx skills add https://github.com/carbon-language/carbon-lang --skill jujutsu-jj-usage

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Contributors working in Carbon repository checkouts that use Jujutsu (jj) instead of Git need clear guidance on which version control commands to run, and risk using the wrong tool or blocking commands that wait on terminal pagers.

Core Features & Use Cases

  • Tool Detection: Detects whether Jujutsu is in use by checking for a .jj directory, enforcing that jj and git are never mixed.
  • Safe Command Invocation: Mandates the --no-pager flag on every jj invocation to prevent commands from blocking on terminal paging.
  • Common Workflows: Provides commands for syncing with remotes (jj git fetch, jj new trunk), inspecting state (jj status, jj log, jj diff), and managing changes (jj commit, jj abandon, jj rebase -o trunk).
  • Use Case: A contributor clones the Carbon repository, finds a .jj directory, and uses this Skill to fetch from the remote, create a new change on top of trunk, and commit their work without ever touching git.

Quick Start

Check whether the repository root contains a .jj directory, and if so use the jj commands from this skill to fetch from the remote and create a new change on top of trunk.

Frequently Asked Questions about Jujutsu (jj) usage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Jujutsu (jj) for version control in the Carbon repository?

First check for a .jj directory in the repository root; if present, use jj commands exclusively. Always pass --no-pager, then use commands like jj git fetch, jj new trunk, and jj commit for typical workflows.

How do I commit changes with Jujutsu instead of git?

Run jj --no-pager commit to record the current change with a description. The Carbon workflow prefers jj commit over combining jj describe and jj new.

Can I use git and Jujutsu together in the same repository?

No. If a .jj directory exists in the repository root, you must use jj and must not use git. If the .jj directory is absent, you must not use jj at all.

Why does my jj command hang or wait for input?

jj may open a pager for long output, blocking automated or scripted invocations. Always invoke commands with the --no-pager flag, for example jj --no-pager log, to prevent this behavior.

How do I rebase a Jujutsu change onto trunk?

Run jj --no-pager rebase -o trunk to move the current change on top of trunk. To discard a change entirely instead, use jj --no-pager abandon.