LinuxCommandLibrary

jj-absorb

Absorb changes into parent commit

TLDR

Move all eligible and unambiguous changes from a revision to other revisions automatically

$ jj absorb [[-f|--from]] [revset] [[-t|--into]] [revsets]
copy

Move only changes in given files from a revision to other revisions
$ jj absorb [[-f|--from]] [revset] [[-t|--into]] [revsets] [filesets]
copy

SYNOPSIS

jj absorb [OPTIONS] [REVISIONS]...

PARAMETERS

-r, --revision REVISION
    Target revision(s) to absorb changes into (default: parent of source)

--source REVSET
    Source revision(s) to absorb changes from (default: working-copy commit)

-m, --message TEXT
    Replace target commit message(s)

-a, --append
    Append to target commit message(s) instead of replacing

--interactive
    Interactively select hunks to absorb

--dry-run
    Show what would be done without changes

--update-unknown-registration <keep|register|delete>
    Handle untracked files (default: keep)

DESCRIPTION

The jj absorb command in Jujutsu (jj), a Git-compatible version control system, moves changes from the working-copy commit into specified target commits. Unlike traditional Git, jj always treats the working copy as a committed state, allowing seamless integration of unstaged modifications.

By default, it absorbs changes into the parent of the working-copy commit (@-), effectively amending the previous commit without a separate staging area. This is ideal for incorporating small fixes or refinements post-commit.

Users can specify --source to select different source revisions and --revision (or -r) for targets. Interactive mode enables hunk-by-hunk selection. It handles multiple revisions, message editing, and unknown files. Dry-run previews actions.

This command streamlines workflows in jj's change-centric model, reducing commit fragmentation while preserving history. It's safer than rebasing for local changes, as jj uses immutable snapshots with operation logs for reversibility.

CAVEATS

Requires no conflicts between source and target; may fail on divergent histories. Use jj log to verify revisions. Not for remote changes—use jj rebase.

EXAMPLES

jj absorb
Absorbs working-copy changes into previous commit.

jj absorb -r abc123
Absorbs into specific revision abc123.

jj absorb --interactive
Selects specific hunks.

WORKFLOW TIP

Pair with jj new for new changes and jj diff to preview before absorbing.

HISTORY

Introduced in Jujutsu (jj) v0.1.0 (2023), developed by Martin von Zweigbergk at Google. Evolved to support revsets and interactivity in v0.18+. jj emphasizes Git compatibility with improved UX.

SEE ALSO

git commit --amend(1), jj squash(1), git add(1), jj describe(1)

Copied to clipboard