Tracked and Tracking Bookmarks
A local Bookmark can be bound to a Bookmark on a remote
repository. One will follow the other.
The two Bookmarks will have these roles:
| Bookmark | Role | Meaning |
|---|---|---|
| Local | Tracking | Monitors the position of a remote Bookmark and tries to stay aligned with its position, following a git fetch |
| Remote | Tracked | Tries to align with the position of a local Bookmark during a git push. |
With the next commands we'll create 3 repositories on the local filesystem:
| Repository | Description |
|---|---|
project-remote | A bare repository to use as a remote. |
ours | A clone of project-remote. It will be your working repository. |
theirs | A second clone of project-remote. It will be the working repository of a hypothetical coworker of yours. |
It's an extraordinarily simple repository: only 3 commits. Yet, plenty to chew on anyway to learn a lot. Let's begin:
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
Both Git and Jujutsu show only the main branch.
$ git log --oneline --graph
* 7dac65a (HEAD, origin/main, main)
$ jj l
@ p (empty)
◆ u main
│
~
and both reveal the existence of the remote branches if asked to:
$ 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)
Learn to read the jj bookmark list output. It tells you:
barexists only onorigin.fooalso exists only onorigin.mainexists as a local Bookmark.- As a branch on
git. - And as a Remote Bookmark on
origin.
- As a branch on
The indentation under main helps visualizing that it is tracking 2
remote Bookmarks: the one on git and the one on origin. These 3
bookmarks will do their best to stay aligned with each other. In fact,
right now all 3 point to the same commit 7dac65ac.