Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

History of a Change

Important

You learn how to inspect a Change’s past.

Every Change has its History.

Try this exercise. Target any Change you like, such as n. Make some modifications to it:

  • Update its description:
    • jj desc -r n -m foo
    • jj desc -r n -m bar
    • jj desc -r n -m baz
  • Check it out and edit some files:
    • jj edit -r n
  • Add a Change before it:
    • jj new -B n

Under the hood, each operation creates a new Git commit, but the immutable Change ID n always points to the most recent one. So, throughout its existence, n goes through different states: in a sense, n has its own history tree.

This isn’t just a metaphor. You can actually isplay that history with evolog:

jj evolog -r n
  ○  nvokxlrr arialdo@ik.me 2026-06-12 22:52:51 c655c8d7
  │  baz
  │  -- operation 2e1a28a42c55 abandon commit 668d65f4f0eea395a4c3d0a7ed890254a60865d4
  ○  nvokxlrr/1 arialdo@ik.me 2026-06-12 22:52:45 6e2c1c9a (hidden)
  │  baz
  │  -- operation 500080ebf19a new empty commit
  ○  nvokxlrr/2 arialdo@ik.me 2026-06-12 22:52:39 983a1599 (hidden)
  │  baz
  │  -- operation 3075743719f1 describe commit 22c5df185272af6f25b1d4227cd271971aa1baa5
  ○  nvokxlrr/3 arialdo@ik.me 2026-06-12 22:52:37 22c5df18 (hidden)
  │  bar
  │  -- operation 3daa0e64a476 describe commit 21a546e29d1cfcebdc0aafd8023c3d60416bff88
  ○  nvokxlrr/4 arialdo@ik.me 2026-06-12 22:52:34 21a546e2 (hidden)
  │  foo
  │  -- operation 4c7fc048be20 describe commit a857703785c7971ec20ccd826e36557f8b7d5a72
  ○  nvokxlrr/5 arialdo@ik.me 2026-06-12 22:52:28 a8577037 (hidden)
  │  Foo
  │  -- operation a6df8a6d9206 describe commit 03e16e725052f4ba32bb0a1a31a029860a86519a
  ○  nvokxlrr/6 arialdo@ik.me 2026-06-10 14:33:07 03e16e72 (hidden)
     Square is interactive

Consider this the meta-repository tracking n’s history. Its states are called n/1, n/2, etc. The /1 is the Change Offset. These are ordinary, but hidden, commits: unlike Git’s reflog, you can use them in commands without learning special syntax.

Warning

How do you inspect the changes stored in n/5?

Tip

Just run jj show n/5.

Simple, isn’t it?

You’ll often use this meta-history to recover lost files.