← 返回命令列表

Linux command

jj-abandon 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Abandon the current working-copy

jj abandon

Abandon a specific

jj abandon [revision]

Abandon multiple revisions

jj abandon [rev1] [rev2]

Abandon a revset

jj abandon "descendants(main)"

Abandon without

jj abandon --restore-descendants [revision]

Abandon and keep bookmarks

jj abandon --retain-bookmarks [revision]

说明

jj abandon marks revisions as abandoned in Jujutsu. Abandoned commits are hidden from default log output, and any descendants are normally rebased onto the abandoned commit's parent so the visible history remains linear. The change IDs survive until garbage collection, so abandoned work can still be recovered via `jj op log` and `jj op restore`. If the working-copy commit is abandoned, Jujutsu automatically creates a new empty working-copy commit on the parent so the workspace is never left without a current change.

参数

--restore-descendants
Do not rewrite descendants of the abandoned commits. Their parent pointers stay the same and their contents are preserved.
--retain-bookmarks
Move bookmarks pointing at abandoned commits to the parent revision instead of deleting them.

FAQ

What is the jj-abandon command used for?

jj abandon marks revisions as abandoned in Jujutsu. Abandoned commits are hidden from default log output, and any descendants are normally rebased onto the abandoned commit's parent so the visible history remains linear. The change IDs survive until garbage collection, so abandoned work can still be recovered via `jj op log` and `jj op restore`. If the working-copy commit is abandoned, Jujutsu automatically creates a new empty working-copy commit on the parent so the workspace is never left without a current change.

How do I run a basic jj-abandon example?

Run `jj abandon` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --restore-descendants do in jj-abandon?

Do not rewrite descendants of the abandoned commits. Their parent pointers stay the same and their contents are preserved.