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

Tracking Remote Bookmarks

Important

You see how to reveal hidden remote branch Changes and make them mutable.

How do you tell Jujutsu you want to work on foo, so it:

  • Stops hiding its Changes?
  • Stops treating them as immutable?

You just declare that you want a local Bookmark foo tracking the remote Bookmark foo@origin:

jj bookmark track foo
Started tracking 1 remote bookmarks.
@  p    (empty)
│ ○  s    **foo**
├─╯
◆  u    **main**
│
~
jj bookmark list foo
**foo**: stnkrwop 00687915 (no description set)
  **@git**: stnkrwop 00687915 (no description set)
  **@origin**: stnkrwop 00687915 (no description set)

Everything checks out:

  • A local Bookmark foo was created.
  • Consequently, a Git branch foo (foo@git) appeared.
  • The remote Bookmark foo@origin is displayed, properly indented under foo, indicating that foo is tracking it.

Unlike Git, all 3 Bookmarks must share the exact same name.

Run jj log again:

@  p    (empty)
│ ○  s    **foo**
├─╯
◆  u    **main**
│
~

As expected:

  • foo Changes are not hidden anymore.
  • And are no longer immutable (see instead of ?)

I guess now you understand why, after jj git clone, I always suggested to run:

jj bookmark track '*'

Tracking bar

Quiz time:

Warning

Track bar too.

Tip

jj bookmark track bar --remote=origin

Or abbreviated:

jj b t bar

The log now shows:

@  p    (empty)
│ ○  s    **foo**
├─╯
│ ○  o    **bar**
├─╯
◆  u    **main**
│
~

Bravo!
It’s time to play with fetch and push.