Committing
Important
Where you get what it means that Jujutsu automatically commits.
Wait a sec. If @ represents the current file system:
@ x empty
◆ z 🔒 empty
which is empty because your project is also empty, what happens if you add a file? Let’s see:
touch README.md
jj log
@ x
◆ z 🔒 empty
Interestingly, x is no longer empty. Git detects a new, untracked
file:
git status
Changes not staged for commit:
new file: README.md
What’s Jujutsu’s opinion?
jj status
Working copy changes:
A README.md
Working copy (@) : xmvkoxku b727840f (no description set)
Parent commit (@-): zzzzzzzz 00000000 (empty) (no description set)
Two things to notice:
- Jujutsu automatically tracked the file (
A README.md). In fact, there’s no equivalent ofgit add. - Easy to miss: the SHA1 changed.
Warning
Inspect
xagain. What’s in it?
Tip
It must contain
README.md! In fact,xand your filesystem are one and the same: change either, and you change both.jj show xCommit ID: b727840fcbf04053c43d30b8581876260a240840 Change ID: xmvkoxkuvlrynmwooqtrxtxptmswruqq Author : Arialdo <arialdo@ik.me> (2026-06-09 16:10:17) Committer: Arialdo <arialdo@ik.me> (2026-06-09 16:10:17) (no description set) Added regular file README.md: (empty)
Oh dear! By creating a file, you performed a git commit --amend
under the hood.
Warning
How do you add content to
README.mdand amendxagain?
Tip
Just edit
README.md!echo "Hello, world" > README.md jj show xCommit ID: 126c51d1a7bddbd205721e64a0824233c68a56a0 Change ID: xmvkoxkuvlrynmwooqtrxtxptmswruqq Author : Arialdo <arialdo@ik.me> (2026-06-09 16:10:17) Committer: Arialdo <arialdo@ik.me> (2026-06-09 16:13:12) (no description set) Added regular file README.md: 1: Hello, worldIf you guessed right, bravo! In Jujutsu, the working directory and repository are the same area and always match. The lines:
Added regular file README.md: 1: Hello, worldconfirm
xholdsREADME.mdwith its content.
It’s yet another SHA1, but to Jujutsu, it’s still Changex.
The mental model is: editing the file system directly edits the commit. This may feel dangerous, but you will see some safer practices like the Squash Workflow later.
How Many Commits Have You Created and Abandoned Already?
Does it matter? Dangling commits are invisible to Git anyway. If you
run git log, Git throws its hands up as though nothing happened:
git log
fatal: your current branch 'main' does not have any commits yet
For Git to see your commit, it needs a branch (a Bookmark, in Jujutsu’s lingo) pointing to it:
jj bookmark set main
Don’t worry, there’s a whole chapter on Bookmarks coming up. All in good time!