LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

jj-arrange

interactively rearrange the Jujutsu commit graph

TLDR

Arrange mutable commits reachable from the working copy (`revsets.arrange`)
$ jj arrange
copy
Arrange a specific revset
$ jj arrange -r [revset]
copy
Arrange several revsets (union)
$ jj arrange -r [revset1] -r [revset2]
copy
Arrange the stack from trunk to @
$ jj arrange -r 'trunk()..@'
copy
Undo an arrange you are not happy with
$ jj undo
copy

SYNOPSIS

jj arrange [-r REVSETS...] [REVSETS...]

DESCRIPTION

jj arrange opens a full-screen TUI for rewriting parent edges of a connected set of mutable commits. It is the closest built-in equivalent of `git rebase -i` / `hg histedit`. Official docs still describe it as under development.The selected revset must be connected (no gaps) and rewritable. Commits just outside the set are shown as context (external parents and children) but cannot be moved. An empty set prints `No revisions to arrange.` and exits.In the TUI, j/k or the arrow keys move the selection. Shift+J / Shift+K (or Shift+Down / Shift+Up) swap the selected commit with its single parent or single child when that neighbor is also in the set. a marks the selection to abandon; p keeps it. c applies the plan as one operation (`arrange revisions`); q or Ctrl+C cancels. Swap is a no-op when the commit has more than one in-set parent or child.Confirming rewrites parents (and abandons marked commits), then rebases descendants as usual. Review with `jj op show -p` and undo with `jj undo`.

PARAMETERS

-r, --revisions REVSETS

Revisions to include. Positional revsets are the same argument. Repeatable; the union is arranged. If omitted, uses the `revsets.arrange` setting (default: `reachable(@, mutable())`).

CONFIGURATION

Default selection and row template, in TOML:

$ [revsets]
arrange = "reachable(@, mutable())"

[templates]
arrange = "builtin_log_compact"
copy
Override the selection per invocation with -r.

INSTALL

sudo pacman -S jujutsu
copy
sudo apk add jujutsu
copy
sudo zypper install jujutsu
copy
brew install jujutsu
copy
nix profile install nixpkgs#jujutsu
copy

CAVEATS

Subcommand of jj. The TUI is still evolving; a stack taller than the terminal historically failed to scroll (fixed in later 0.39-era releases). Immutable commits cannot be arranged. Canceling is treated as an error (`Canceled by user`). For a single move, `jj rebase -A`/`-B` is often enough.

SEE ALSO

jj(1), jj-rebase(1), jj-squash(1), jj-split(1), jj-abandon(1), jj-undo(1)

RESOURCES

Copied to clipboard
Kai