Tracking Remote Bookmarks
This bears the question: how to tell Jujutsu that you want to work on
foo, so:
- It stops hiding its Changes.
- It stops treating them as immutable?
$ 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)
You declare that you want a local Bookmark tracking
foo@origin. Use this command:
$ jj bookmark track foo --remote=origin
Started tracking 1 remote bookmarks.
$jj log
@ 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
foohas been created. - Bound to it, a Git branch
foo(foo@git) immediately appeared. - Finally, the remote Bookmark
foo@originis displayed, properly indented underfoo, to signify thatfoois tracking it.
Notice how, again, the 3 Bookmarks share the same name. This is a
difference from Git, where a local branch can track a remote branch
with a completely independent name.
Also note two things:
- As expected, now
jj logshows the Changes offoo:
@ p (empty)
│ ○ s foo
├─╯
◆ u main
│
~
- The Changes of
fooare no longer immutable.
You should have understood by now why, in the past exercises, right
after a jj git clone, I always invited you to do:
jj bookmark track "*" --remote origin
It served to make all the Changes mutable.
Tracking bar
Alright, track bar too:
Solution
Solution
Sure! jj bookmark track bar --remote=origin
You could also have abbreviated it as:
jj b t bar
Now the log shows:
@ p (empty)
│ ○ s foo
├─╯
│ ○ o bar
├─╯
◆ u main
│
~
All the Changes (except for those of the main trunk) are now
mutable. As expected, each local Bookmark is tracking a respective
Bookmark on git and on origin:
$ jj bookmark list -a
bar: ossuomlo fa22ec04 (no description set)
@git: ossuomlo fa22ec04 (no description set)
@origin: ossuomlo fa22ec04 (no description set)
foo: stnkrwop 00687915 (no description set)
@git: stnkrwop 00687915 (no description set)
@origin: stnkrwop 00687915 (no description set)
main: urvnvxtx 7dac65ac (no description set)
@git: urvnvxtx 7dac65ac (no description set)
@origin: urvnvxtx 7dac65ac (no description set)
Time to discover what happens when you move Bookmarks around and you
play with fetch and push.