Merge commits in the stack
Merge commits in your jujutsu stack by moving changes from a commit into its parent. Use this to clean up WIP commits, combine related changes, or squash incremental work before sharing.
/plugin marketplace add edmundmiller/dotfiles/plugin install jj@dotfiles-pluginsrevisionclaude-haiku-4-5jj statusjj log -r @ --no-graph -T 'concat(change_id.short(), ": ", description)'jj log -r @- --no-graph -T 'concat(change_id.short(), ": ", description)'jj log -r 'ancestors(@, 5)' -T 'concat(change_id.short(), ": ", description)' --no-graphMerge commits in the jujutsu stack.
Usage Modes:
Default (no argument): Merge current commit (@) into its parent (@-)
jj squash
This moves all changes from @ into @-, then abandons @.
With revision: Merge a specific revision into its parent
jj squash -r <revision>
Useful for cleaning up a specific commit in the stack.
When to use:
Workflow:
jj log and confirm the changesImportant:
jj undojj squash -i for interactive mode to select specific changesExample scenarios:
Scenario 1: Merge current WIP into parent
# Before: @ = "WIP: fix tests", @- = "Add login feature"
jj squash
# After: @ = "Add login feature" (now includes test fixes)
Scenario 2: Merge specific revision
# Merge revision abc123 into its parent
jj squash -r abc123
Scenario 3: Interactive squash
# Choose which changes to move
jj squash -i
Show result: !jj log -r 'ancestors(@, 3)' -T 'concat(change_id.short(), ": ", description)' --no-graph