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

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?
Let jj bookmark list help you.

Tip

jj bookmark list --all-remotes shows:

**foo**: ksvskswq dd2904b3 (no description set)
 **@git**: ksvskswq dd2904b3 (no description set)
 **@origin** (behind by 1 commits): stnkrwop 00687915 (no description set)
  • Local foo is on k, aligned with Git branch foo@git.
  • The origin remote stayed behind (behind by 1 commits) on s.
  • foo should be pushed so foo@origin can 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**
│
~