You would just use jj split to break the working commit into two, choosing which parts to put in which commit
Ah right so I can say "jj put this change into a new/existing commit before this one"?
[delayed]
Someone already said this, but you just use jj split. Either split the whole file or use interactive mode to split the exact lines. You could also use squash if you want to move it to an existing revision/commit.
It's vastly more efficient and ergonomic - no staging area to think about, remember, stumble over, etc.
It's all dead simple if you use jjui - don't even need to learn any jj syntax
Re:Jujutsu Primer
by orbisvicis on Friday November 20, 2026 @09:21AM
(#50575019)
For me:
* working tree == in progress
* staging area == finished
How do can I split modifications to a single file into multiple commits? (In git)
1. I write some code.
2. I realise it makes sense to commit as two commits.
3. I stage changes for the first commit & commit it.
4. I stage the remaining changes and commit those.
How would that work in JJ? I guess you do things in a different order somehow?