# Jujutsu (jj) usage

> Instructions for using Jujutsu (jj) for version control in the Carbon repository.

- Skill: `carbon-language/jujutsu-jj-usage` (Agent Skill)
- Install (CLI): `npx skillmds@latest add carbon-language/jujutsu-jj-usage`
- Raw SKILL.md: https://api.skillmd.com/api/skills/carbon-language/jujutsu-jj-usage/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: carbon-language (https://skillmd.com/u/carbon-language)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/carbon-language/jujutsu-jj-usage

---


# Jujutsu (jj) usage

<!--
Part of the Carbon Language project, under the Apache License v2.0 with LLVM
Exceptions. See /LICENSE for license information.
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-->

[Jujutsu](https://github.com/jj-vcs/jj) is a Git-compatible version control
system that may be used in Carbon checkouts.

> [!IMPORTANT] You can detect if Jujutsu is in use by checking for a `.jj`
> directory in the repository root. If present, you **must** use `jj` and **must
> not** use `git`. If absent, you **must not** use `jj`.

## General usage

Always use the `--no-pager` flag when invoking `jj` to prevent the command from
blocking or waiting for terminal paging.

## Common commands

### Syncing with remote

-   **Fetch from remote**: `jj --no-pager git fetch`
-   **Create a new change on top of trunk**: `jj --no-pager new trunk`
-   **Show repository status**: `jj --no-pager status`
-   **Show commit history**: `jj --no-pager log`

### Managing changes

-   **View diff of current changes**: `jj --no-pager diff`
-   **Commit changes**: `jj --no-pager commit`
    -   _Note_: Prefer using `jj commit` over the combination of `jj describe`
        and `jj new`.
-   **Abandon/discard current changes**: `jj --no-pager abandon`
-   **Rebase current change onto trunk**: `jj --no-pager rebase -o trunk`

