Creating a new commit
We have now added some changes and a description to a commit.
Let's say we want to make another change to the project which should belong to a different commit.
You can create a new one with the command jj new
and see what happened with jj log
:
@ pwpuwyto alice@local 2025-07-22 20:22:36 35de496a │ (empty) (no description set) ○ mkmqlnox alice@local 2025-07-22 20:20:34 git_head() 5b79353a │ Add readme with project title ◆ zzzzzzzz root() 00000000
There are a few things to observe here:
- The new commit is a child of our previous working copy commit.
- The new commit became our working copy, meaning any further file changes will be recorded into the new commit.
- The previous commit is marked with
git_head()
. This marker is not important and you can ignore it. - The previous commit has a different symbol (circle) than the root commit (diamond). This is related to an important feature, which we'll learn about later.
At this point, we've closed the loop. You make changes, give them a description and finish off by creating a new commit that descends from the one you just completed. Rinse and repeat - that's the most basic version-control workflow.