jj-commit(1)

πŸ’– jj-commit β€” bestie, let's lock in πŸ’–

okay so this is the jj-commit manual page, from the Jujutsu (jj) command set. technically it lives in section 1 of the general commands manual, which is giving "commands you type in a terminal" energy. and there's a default alias: ci. so if you're out here typing jj ci like it's nothing, that's this command. slay.


✨ NAME ✨

jj-commit β€” update the description and create a new change on top

default alias: ci πŸ‘‘

🌸 SYNOPSIS 🌸

jj commit [-i|--interactive] [-R|--repository] [--ignore-working-copy]
[--tool] [-m|--message] [--no-integrate-operation] [--editor]
[--ignore-immutable] [--at-operation] [--debug] [--color] [--quiet]
[--no-pager] [--config] [--config-file] [-h|--help] [FILESETS]

like, that's the whole vibe in one block. don't worry bestie, we're gonna go through every single one of these. no skips. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Update the description and create a new change on top. and yes, the default alias is ci β€” so this command literally has a nickname. iconic honestly.

So when you call jj commit without path arguments and without --interactive, it is equivalent to running jj describe and then jj new. that's it. two commands, one vibe. ✨

When you do use --interactive, or you pass path arguments, here's the tea: the selected changes stay in the current commit, and the remaining changes get moved to a new working-copy commit on top. which is very similar to jj split. but not identical, and the differences matter:

  • jj commit is not interactive by default (it selects all changes). no prompts, no questions, it just takes everything.
  • jj commit doesn't have a -r option. periodt. it always acts on the working-copy commit (@).
  • jj split (when you don't pass -o/-A/-B) will move bookmarks forward from the old change to the child change. jj commit doesn't move bookmarks forward. lowkey a whole different behavior, so don't get it twisted.
  • jj split lets you move the selected changes to a different destination with -o/-A/-B. jj commit does not have that range. it's not that girl, and that's fine.

πŸ’– OPTIONS πŸ’–

here we go bestie, every flag, every value, no cap.

  • -i, --interactive β€” interactively choose which changes to include in the current commit. you get to pick and choose, main character energy in the selection process. πŸŽ€
  • --tool <NAME> β€” specify the diff editor to be used. heads up: this implies --interactive. it doesn't just quietly set a tool and move on, it drags interactivity in with it.
  • -m, --message <MESSAGE> β€” the change description to use. also: it will not open an editor. so if you've already written your little message, this is the move.
  • --editor β€” open an editor to edit the change description.

and this part is important, bestie: it forces an editor to open when you're using --message, so you can edit the message afterwards. that's the whole point β€” you give it a message AND you still get to go in and tweak it. 🫢

  • -h, --help β€” print help. (and see a summary with -h.) short king behavior, love that.
  • [FILESETS] β€” put these paths in the current commit. that's literally what it does. you hand it paths, it commits them. 🌸

🌈 GLOBAL OPTIONS 🌈

okay these aren't special to jj commit β€” they're the global ones, the ones basically every jj command carries around. but you still need to know them, so here we are. πŸ’œ

  • -R, --repository <REPOSITORY> β€” path to the repository to operate on.

by default, Jujutsu searches for the closest .jj/ directory in an ancestor of the current working directory. so it just goes walkin' up the tree lookin' for the repo. cute.

  • --ignore-working-copy β€” don't snapshot the working copy, and don't update it.

by default, Jujutsu snapshots the working copy at the beginning of every command. the working copy is also updated at the end of the command, if the command modified the working-copy commit (@). if you wanna avoid snapshotting the working copy and instead see a possibly stale working-copy commit, you can use --ignore-working-copy. this may be useful e.g. in a command prompt, especially if you have another process that commits the working copy. (iykyk β€” it's a whole situation. 😭)

also! loading the repository at a specific operation with --at-operation implies --ignore-working-copy. so you don't even have to say it twice.

  • --no-integrate-operation β€” run the command as usual but don't integrate any operations.

when this option is given, the operations will still be created as usual, but they will not be integrated to the operation log. the working copy will also not be updated.

the command will print the resulting operation ID. you can pass that to e.g. jj --at-op to inspect the resulting repo state, or you can pass it to jj op restore to restore the repo to that state. you can also pass the ID to jj op integrate to integrate the operation.

⚠️ note that this does not prevent side effects outside the repo. for example, jj git push --no-integrate-operation will still perform the push. like, it still pushes. fr fr. don't get caught slipping. πŸ’€
  • --ignore-immutable β€” allow rewriting immutable commits.

by default, Jujutsu prevents rewriting commits in the configured set of immutable commits. this option disables that check and lets you rewrite any commit but the root commit.

and this next bit is crucial: this option only affects the check. it does not affect the immutable_heads() revset or the immutable template keyword. so don't expect it to do anything else, bestie. it's one very specific thing. πŸŽ€

  • --at-operation <AT_OPERATION> β€” operation to load the repo at.

operation to load the repo at. by default, Jujutsu loads the repo at the most recent operation, or at the merge of the divergent operations if any.

you can use --at-op=<operation ID> to see what the repo looked like at an earlier operation. for example, jj --at-op=<operation ID> st will show you what jj st would have shown you when the given operation had just finished. --at-op=@ is pretty much the same as the default, except that divergent operations will never be merged.

use jj op log to find the operation ID you want. any unambiguous prefix of the operation ID is enough. so you don't have to type the whole thing. πŸ™ˆ

when loading the repo at an earlier operation, the working copy will be ignored, as if --ignore-working-copy had been specified.

and here's a fun one: it is possible to run mutating commands when loading the repo at an earlier operation. doing that is equivalent to having run concurrent commands starting at the earlier operation. there's rarely a reason to do that, but it is possible. (so, like, technically possible, spiritually chaotic. 😭)

  • --debug β€” enable debug logging. it's giving "for when things are weird and you need receipts." πŸ”₯
  • --color <WHEN> β€” when to colorize output.

possible values:

  • always
  • never
  • debug
  • auto

literally just pick your aesthetic. 🌈

  • --quiet β€” silence non-primary command output.

for example, jj file list will still list files, but it won't tell you if the working copy was snapshotted or if descendants were rebased.

warnings and errors will still be printed. so it's quiet, not silent-silent. important distinction. ✨

  • --no-pager β€” disable the pager. no scrolling situation, just output, right there.
  • --config <NAME=VALUE> β€” additional configuration options (can be repeated). yes bestie, repeat it as many times as you want.

the name should be specified as TOML dotted keys. the value should be specified as a TOML expression. if the string value isn't enclosed by any TOML constructs (such as array notation), quotes can be omitted. (so like, you can be a little loose with the quotes sometimes. key word: sometimes.) πŸ’…

  • --config-file <PATH> β€” additional configuration files (can be repeated). again, repeatable. stack 'em up. πŸŽ€

ok that's literally the whole page, every flag accounted for, nothing skipped, we ate. πŸ’…βœ¨

anyway bestie, this page came to you from the commit source (that's the file the manual was generated from), for the jj-commit(1) manual page β€” so, like, the Jujutsu general commands manual, section 1. that's the whole citation, that's the whole vibe check. go forth and commit. πŸ‘‘πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from