jj Commit Cycle
The jj equivalent of git add -A && git commit -m "<msg>". Two commands, executed 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 (a jj repo, possibly colocated).- Working copy has changes to describe (
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 (see
~/.claude/rules/coding.mdfor this user's<type>(<scope>): <subject>format):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 the stack layout:
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 feel like the commit message "reverted". - 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_push_pr(this plugin) orjj git push --change @.