LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

jj-operation-abandon

abandon operations from Jujutsu's operation log

TLDR

Abandon a specific operation
$ jj operation abandon [operation-id]
copy
Abandon an operation and all of its ancestors (discard old history)
$ jj op abandon ..[operation-id]
copy
Discard recent operations after restoring to an earlier state
$ jj op restore [operation-id] && jj op abandon [operation-id]..@-
copy
List operations before choosing what to abandon
$ jj op log
copy
Garbage-collect objects made unreachable by abandon
$ jj util gc
copy

SYNOPSIS

jj operation abandon operation

DESCRIPTION

jj operation abandon (alias jj op abandon) removes operations from Jujutsu's operation log. Every mutating jj command records an operation; abandoning those records is how you shrink the log and make old commits, views, and predecessors eligible for garbage collection.To discard old history, pass a range ending at the last operation you want gone: jj op abandon ..<operation ID> abandons that operation and all of its ancestors. Descendants of the abandoned operations are reparented onto the root operation so the remaining log stays connected.To discard recent history after a restore, first run jj op restore <operation ID>, then jj op abandon <operation ID>..@-. Restore creates a new operation that points the repo at the earlier view; abandon then drops the now-unwanted later operations from the log.Previous versions of a change (predecessors) are also discarded when they become unreachable from the operation history. The abandoned operations, commits, and other unreachable objects can later be collected with jj util gc. This is not jj abandon, which hides revisions in the commit graph rather than operations in the operation log.

PARAMETERS

OPERATION

The operation or operation range to abandon. Range syntax such as `..<id>` (ancestors through that operation) and `<id>..@-` (from that operation up to the parent of the current operation) is accepted.
--help
Display help information.

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. Operation IDs come from jj op log, not from jj log. Abandoning is not the same as jj undo or jj op restore: those create new operations; this removes operations. After a large abandon, run jj util gc if you want the on-disk objects reclaimed. Do not confuse this with jj abandon, which abandons revisions.

SEE ALSO

RESOURCES

Copied to clipboard
Kai