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

Tracked and Tracking Bookmarks

Important

You learn to control remote branches.

A local Bookmark can be bound to a remote Bookmark. They follow each other based on these roles:

BookmarkRoleMeaning
LocalTrackingMonitors the position of a remote Bookmark and tries to stay aligned with its position, following a git fetch
RemoteTrackedTries to align with the position of a local Bookmark during a git push.

Remotes in Practice

Let’s create 3 local repositories:

RepositoryDescription
project-remoteA bare Git repo to act as the remote.
oursA clone of project-remote. Your working repo.
theirsAnother clone. The working repo of a hypothetical coworker.

There are only 3 commits, but don’t worry: it’s plenty to chew on.

git clone ssh://git@codeberg.org/arialdo/jj-remote.git project-remote --bare
jj git clone project-remote ours
jj git clone project-remote theirs
cd ours

Displaying Remote Bookmarks

By default, Git and Jujutsu only show the main branch.

git log --oneline --graph
* 7dac65a (**HEAD**, **origin/main**, **main**)
jj log
@  p    (empty)
◆  u    **main**
│
~

Remote branches are displayed only when asked explicitely:

git branch -a
* (no branch)
  **main**
  **remotes/origin/bar**
  **remotes/origin/foo**
  **remotes/origin/main**
jj bookmark list --all-remotes
**bar@origin**: ossuomlo fa22ec04 (no description set)
**foo@origin**: stnkrwop 00687915 (no description set)
**main**: urvnvxtx 7dac65ac (no description set)
  **@git**: urvnvxtx 7dac65ac (no description set)
  **@origin**: urvnvxtx 7dac65ac (no description set)

This means:

  • bar exists only on origin.
  • foo exists only on origin.
  • main exists as a local Bookmark, as a branch on git, and as a remote Bookmark on origin.

The indentation under main helps you see that it tracks both git and origin. Jujutsu will try to keep these 3 bookmarks aligned. Right now, all point to 7dac65ac.