2025-07-23

Jujutsu VCS (jj)#

man pages#

To get man jujutsu when installed locally via mise:

jj util install-man-pages ~/.local/share/man/

Cheatsheet#

jj git init --colocate
jj # default-command
jj describe -m foo
jj edit x

jj bookmark move main --to @-
jj bookmark track main@origin
jj git push
jj new

Edit User Config#

jj config edit --user

jj without arguments#

Runs the default-command that can be configured like this:

[ui]
default-command = "status"

jj describe: show diff while editing the commit message#

[templates]
# show diff when editing description
draft_commit_description = '''
concat(
  coalesce(description, builtin_draft_commit_description, "\n"),
  surround(
    "\nJJ: This commit contains the following changes:\n", "",
    indent("JJ:     ", diff.stat(72)),
  ),
  "\nJJ: ignore-rest\n",
  diff.git(),
)
'''

via docs / config / default-description

jj equivalent to git commit -a#

Suppose the working-copy looks like this:

$ jj
Working copy changes:
A .idea/.gitignore
A .idea/misc.xml
M README.md
Working copy  (@) : vvzvnnzq cc47b108 (no description set)
Parent commit (@-): usqrztuz 2cdf0244 first passing test \o/

I really want to commit the changes to .idea first before further refining and finally commiting the README file.

Easy. I find it beautiful:

jj commit .idea/
# Give it a description.
# Done!

https://jj-vcs.github.io/jj/latest/FAQ/#can-i-interactively-create-a-new-commit-from-only-some-of-the-changes-in-the-working-copy-like-git-add-p-git-commit-or-hg-commit-i

jj integrate old commit into working-copy#

Suppose the log looks like this

@  yluqmlyo felix@felixhummel.de 2025-07-23 21:39:37 89c9c757
│  foo
○  rvnkzloy felix@felixhummel.de 2025-07-23 21:39:23 git_head() 2e654e76
│  bar
○  tsrnvxmq felix@felixhummel.de 2025-07-23 21:24:09 c6e14b71
│  (no description set)
◆  yqqovyyy felix@felixhummel.de 2025-07-23 14:43:39 master 18ba7a77
│  baz

To apply the changes made in tsrnvxmq to the working-copy @:

jj squash --from ts --into @

Nice! 🤓

jj abandon#

Basically git reset HEAD; git checkout ..

jj abandon

To undo this simply

jj undo