#+TITLE: Jj First Time This is the one-time setup that made =jj git push= work in this repository without extra flags or bookmark fiddling. It is written down so it can be reproduced in a fresh clone. * Why it does not "just work" out of the box In Jujutsu a /bookmark/ is a named pointer to a commit, like a Git branch, but unlike a Git branch it does *not* move forward by itself when you commit[fn:bookmarks]. =jj git push= only pushes bookmarks that are /tracked/ and that are ahead of their remote counterpart. So after #+begin_src shell jj commit -m "some work" #+end_src the local =master= bookmark still points at the previous commit, and a plain =jj git push= reports: #+begin_example Warning: No bookmarks/tags found in the default push revset: remote_bookmarks(remote=origin)..@ #+end_example The usual fix is to move the bookmark by hand every time: #+begin_src shell jj bookmark advance master # or: jj bookmark set master -r @- jj git push #+end_src * The setup used here For a simple single-bookmark repository like this one, the experimental "advance branches" feature can move the bookmark for us[fn:config]. The repo-local configuration is: #+begin_src toml [experimental-advance-branches] enabled-branches = ["master"] disabled-branches = [] #+end_src set with: #+begin_src shell jj config set --repo experimental-advance-branches.enabled-branches '["master"]' jj config set --repo experimental-advance-branches.disabled-branches '[]' #+end_src Now =jj commit= advances =master= to the commit it just created, and a plain =jj git push= pushes it. The feature only advances a bookmark that already points at the working copy's parent (=@-=)[fn:atminus]; it will not skip a bookmark forward from an older commit. So when adopting this, align =master= with the tip once: #+begin_src shell jj bookmark set master -r @- #+end_src After that every new commit keeps it there. (This was needed here because =master= was still three commits behind.) The bookmark must also be /tracked/. When a workspace is cloned or initialised this is normally automatic for the default branch; otherwise: #+begin_src shell jj bookmark track master@origin #+end_src * Everyday commands #+begin_src shell jj st # status of the working-copy commit jj diff # what changed jj log # history / bookmark position jj commit -m "..." # describe @ and start a new empty @ on top jj git push # push master (tracked) to origin jj git fetch # update remote bookmarks #+end_src The working copy is itself a commit. Edits are snapshotted automatically, so there is no staging area. * Caveats - =experimental-advance-branches.enabled-branches= is experimental. It advances every matching bookmark that is an ancestor of the new commit, which is fine while =master= is the only bookmark here. If more bookmarks appear, list them explicitly or fall back to =jj bookmark advance=[fn:fallback]. - Jujutsu refuses to push commits with an empty description. Describe them, squash them, or pass =--allow-empty-description=. - The configuration lives in =~/.config/jj/repos//config.toml= (repo scope), so it is per working copy, not committed to Git. #+begin_center October, 2026. Sequel, for when habit wins and bare Git commits anyway: [[file:JjVsGitHabit.org][JjVsGitHabit]]. #+end_center [fn:bookmarks] Jujutsu documentation, /Using Jujutsu with GitHub and GitLab Projects/, https://docs.jj-vcs.dev/latest/github; and the neugierig.org tech notes, /Understanding Jujutsu bookmarks/, https://neugierig.org/software/blog/2025/08/jj-bookmarks.html, for the local-versus-tracking distinction. [fn:config] The sample configuration in jj-vcs/jj discussion #3549, /Feedback for the experimental advance-branches feature/, https://github.com/jj-vcs/jj/discussions/3549; the option itself is documented in =cli/src/config-schema.json= for jj 0.45.1, https://github.com/jj-vcs/jj/blob/v0.45.1/cli/src/config-schema.json. The long-running wish for this behaviour is jj-vcs/jj issue #2338, https://github.com/jj-vcs/jj/issues/2338, also flagged by Steve Klabnik on Hacker News, https://news.ycombinator.com/item?id=45677946. [fn:atminus] Maintainer clarification in discussion #3549: it advances the bookmark at =@-= to =@= before the new commit is created. [fn:fallback] André Arko, /stupid jj tricks/, https://andre.arko.net/2025/09/28/stupid-jj-tricks, for the =tug= alias and the =closest_pushable= revset; the =jj bookmark advance= defaults come from the Configuration page, https://docs.jj-vcs.dev/latest/config. #+LF