Moving and Pushing Bookmarks
Important
You finally publish your branches to remotes.
Build a commit on top of foo:
jj new foo
echo "hello world" > hello.txt
@ k
○ s **foo**
│ ○ o **bar**
├─╯
◆ u **main**
│
~
As expected, local Bookmark foo didn’t follow your Current Change.
Moving Bookmarks
To update foo to point to k, you have 2 options:
- Explicitly specify the target with
jj bookmark move(jj b m):
jj bookmark move foo -t k
- Let Jujutsu automatically move it forward with
jj bookmark advance(jj b a):
Misalignments
Look at what you get moving foo:
@ k **foo***
○ s **foo@origin**
│ ○ o **bar**
├─╯
◆ u **main**
│
~
Warning
Can you explain to yourself what this means?
Letjj bookmark listhelp you.
Tip
jj bookmark list --all-remotesshows:**foo**: ksvskswq dd2904b3 (no description set) **@git**: ksvskswq dd2904b3 (no description set) **@origin** (behind by 1 commits): stnkrwop 00687915 (no description set)
- Local
foois onk, aligned with Git branchfoo@git.- The
originremote stayed behind (behind by 1 commits) ons.fooshould be pushed sofoo@origincan align.
If you specify a Bookmark, Jujutsu shows only the essential:
jj b l foo
**foo**: ksvskswq dd2904b3 (no description set)
**@origin** (behind by 1 commits): stnkrwop 00687915 (no description set)
stating foo and foo@origin don’t match anymore. jj log agrees:
@ k **foo***
○ s **foo@origin**
│ ○ o
├─╯
◆ u
│
~
Pushing to Remotes
To align foo@origin with your local foo, you need jj git push. Indeed, the asterisk in foo* is Jujutsu suggesting you to
push:
jj git push --bookmark=foo --remote=origin
or, just:
jj git push -b foo
If you try, you’ll get:
Error: Won't push commit dd2904b35cee since it has no description
Hint: Rejected commit: ksvskswq dd2904b3 foo* | (no description set)
Good boy, Jujutsu! It gives you local freedom but strictly adheres to Git’s conventions when dealing with remotes: Git rejects descriptionless commits. Fine:
jj desc -m "Hello, world"
jj git push -b foo
Done. Admire how your Bookmarks are nicely aligned:
@ k Hello, world **foo**
○ s
│ ○ o **bar**
├─╯
◆ u **main**
│
~