jj-squash
Combine changes into single commit
TLDR
Move all changes from current revision to its parent
Move all changes from given revision to its parent
Move all changes from given revision(s) to given other revision
Interactively choose which parts to squash
SYNOPSIS
jj squash [-r, --revision <REVISION>]
PARAMETERS
-h, --help
Print help information
-r, --revision <REVISION>
Revision to squash working-copy changes into (default: working-copy parent)
DESCRIPTION
In Jujutsu (jj), a Git-compatible version control system, jj squash combines changes from the working copy into its parent commit, creating a cleaner history.
This command is ideal for tidying up local commits before sharing. Unlike Git's manual rebase or amend workflows, jj squash operates automatically and safely, leveraging jj's advanced conflict handling and automatic rebase features. It updates the working copy to match the new squashed commit, preserving uncommitted changes if any remain.
When invoked without options, it targets the working-copy parent. Squashing merges the diff from working copy onto the specified revision, effectively discarding intermediate commits in favor of a single, unified change. This promotes concise histories and simplifies collaboration.
Key benefits include non-destructive operation (jj's DAG allows easy undo via jj undo) and seamless integration with jj's change-based model, where commits represent snapshots and changes track diffs.
CAVEATS
Only squashes working-copy changes; committed changes require jj rebase -d or similar. Ensure no concurrent operations to avoid conflicts.
EXAMPLE
jj squash
Squash into default parent.
jj squash -r abc123
Squash into specific revision.
UNDO
Use jj undo immediately after to revert.
HISTORY
Part of Jujutsu (jj) VCS, developed by Martin von Zweigbergk starting 2022 at Google. Squash introduced early for streamlined workflows, evolving with jj's 0.1+ releases to support Git interop.


