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

Reset your progress

To reset your progress to the start of this chapter, run the following command:

curl https://s2p2.github.io/jj-for-everyone/reset.sh | bash -s track
cd ~/jj-tutorial/repo

This chapter simulates starting fresh by re-cloning a repository, as if on a new computer.

# Simulate a fresh clone
cd ~
rm -rf ~/jj-tutorial/repo
jj git clone ~/jj-tutorial/remote ~/jj-tutorial/repo
cd ~/jj-tutorial/repo

# roleplay as Alice
jj config set --repo user.name "Alice"
jj config set --repo user.email "alice@local"
jj metaedit --update-author

Let's confirm everything went well with jj log:

@  yuxnowup alice@local 2025-08-23 20:01:42 1043cd89
│  (empty) (no description set)
◆  wkywrwmu bob@local 2025-08-23 20:01:22 main git_head() 36c08763
│  Add submission instructions
~

We've got two issues. First, a commit that was never pushed is now lost permanently. This is a reminder to always push your work. The only fix is to recreate.

echo 'print("Hallo, Welt!")' >> hello.py
echo 'print("Bonjour, le monde!")' >> hello.py
jj commit -m "Print German and French grettings as well"

and push it:

jj bookmark move main -t @-
jj git push

Second, a commit that was pushed is not visible in the default log. It exists on the remote but is hidden. You can find it with jj log --revisions 'all()':

@  nkvmznqz alice@local 2025-08-23 21:18:57 e579e9a8
│  (empty) (no description set)
◆  vmztslml alice@local 2025-08-23 21:18:57 main git_head() a928e18a
│  Print German and French grettings as well
◆  vwkzzxum bob@local 2025-08-23 21:18:20 7a76ce52
│  Add submission instructions
│ ◆  zkwmvzlq alice@local 2025-08-23 21:18:20 push-zkwmvzlqluot@origin a7cd6be9
├─╯  WIP: Add for loop (need to fix syntax)
◆    pqoyoror alice@local 2025-08-23 21:18:20 94608da3
├─╮  (empty) Merge code and documentation for hello-world
│ ◆  owrwuqyr alice@local 2025-08-23 21:18:20 22f32788
│ │  Add Python script for greeting the world
◆ │  vpzorutw bob@local 2025-08-23 21:18:20 9148e791
├─╯  Document hello.py in README.md
◆  pkpoursq alice@local 2025-08-23 21:18:20 02f136e2
│  Add project description to readme
◆  tkpkmszl alice@local 2025-08-23 21:18:20 66c2503f
│  Add readme with project title
◆  zzzzzzzz root() 00000000

The bookmark appears as push-zkwmvzlqluot@origin. The @origin suffix indicates a remote bookmark that is not tracked locally.

Bookmark tracking

When you clone a repository, jj only tracks the main bookmark by default. Other remote bookmarks are left untracked to avoid cluttering your log with collaborators' work-in-progress.

To make a remote bookmark visible in your default log and to be able to push updates to it, you must explicitly track it:

jj bookmark track push-zkwmvzlqluot@origin

Now, a regular jj log will show the bookmark again:

@  nkvmznqz alice@local 2025-08-23 21:18:57 e579e9a8
│  (empty) (no description set)
◆  vmztslml alice@local 2025-08-23 21:18:57 main git_head() a928e18a
│  Print German and French grettings as well
~  (elided revisions)
│ ○  zkwmvzlq alice@local 2025-08-23 21:18:20 push-zkwmvzlqluot a7cd6be9
├─╯  WIP: Add for loop (need to fix syntax)
◆  pqoyoror alice@local 2025-08-23 21:18:20 94608da3
│  (empty) Merge code and documentation for hello-world
~