jj Commit Cycle
The jj equivalent of git add -A && git commit -m "<msg>". Two commands, in order, with a verification step.
When to use
You (or the user) just finished an atomic edit in a jj working copy and want to preserve it before starting the next change.
Prerequisites
.jj/exists in the repo root (jj-native or colocated).- Working copy has changes (
jj stshows non-empty output).
Steps
Survey what will be preserved:
jj st jj diff --statDescribe the current change. Follow the repo's commit convention (typically
<type>(<scope>): <subject>):jj describe -m "<type>(<scope>): <subject>"Open a new child change so the just-described change is finalized and future edits land on a fresh
@:jj newVerify:
jj log -r '::@' --limit 3
Common mistakes
- Skipping step 3: any further edits get absorbed into the change you just "committed", silently polluting it.
- Running
git commit: jj does not track the resulting commit as@; subsequentjj describewill appear to "revert" the commit message. - Using deprecated
jj commit -m: alwaysjj describe -m+jj new.
Related
- Multi-change cleanup:
jj squash --from <src> --into <dst>,jj split. - Recovery if the wrong change was described:
jj op undo. - Pushing after the cycle:
jj git push --change @(creates apush-<change-id>bookmark). If thenwiizo/jujutsu.fishplugin is installed,jj_push_prchains that withgh pr create.