Use when the agent needs to move changes into a parent revision or amend a jj commit (equivalent to git commit --amend)
jj squash [OPTIONS] [PATHS]...
Moves changes from one revision into another. By default, moves all changes from the working copy (@) into its parent (@-).
--from <REVSET> - Source revision (default: @)--into <REVSET> - Destination revision (default: parent of source)-r, --revision <REVSET> - Shorthand for --from-m, --message <MESSAGE> - New description for destination-i, --interactive - Interactively select changes to squash-u, --use-destination-message - Keep destination's message[PATHS] - Only squash changes to these pathsgit commit --amend# Amend parent with all working copy changes (most common)
jj squash
# Amend with a new message
jj squash -m "Updated implementation"
# Squash only specific files into parent
jj squash src/main.rs
# Interactively select what to squash
jj squash -i
# Squash a specific revision into its parent
jj squash --from @--
# Squash into a non-parent revision
jj squash --from @ --into abc123
# Keep the destination's existing message
jj squash -u
@)jj squash to fold into parentjj new to start next logical changeAfter squashing, show the log to confirm the changes were moved. Note that interactive mode (-i) requires terminal interaction.