Skip to content

jj fzf help

Tim Janik edited this page Nov 5, 2024 · 6 revisions

JJ-FZF

  The jj-fzf shell script is a convenience script that wraps a number of jj commands, based on the jj log graph view. The commands executed to modify history are printed on stderr for the user to retrace the repository modifications. All commands are available via the following Keyboard shortcuts:

Alt-A: abandon Use jj abandon to remove the currently selected revision (or divergent commit) from the history.

Alt-B: bookmark Use jj bookmark {create|set -B} to (re-)assign a bookmark name to the currently selected revision.

Alt-C: commit Use jj commit to describe the currently selected revision and create a new child revision as working-copy.

Alt-D: delete-refs Use jj bookmark list+delete to list, selected and delete bookmarks and tags.

Alt-E: diffedit Use jj diffedit to modify the content diff of the currently selected revision.

Alt-F: split-files Use jj split in a loop to split each file modified by the currently selected revision into its own commit.

Alt-I: split-interactive Use jj split to interactively select content diff hunks to be split into a new commit. No text editor is invoked and the new commit gets an empty description.

Alt-K: backout Use jj backout to create a new commit that undoes the changes made by the currently selected revision and apply the changes on top of the working-copy.

Alt-L: line-history EXPERIMENTAL: View history of each line.

Alt-M: merging Start a dialog to select parents for a new merge commit, using jj new REVISIONS.... For exactly two parents, a default commit message is suggested. Commits with no description are ignored.

Alt-N: new-before Use jj new --insert-before to create and insert a new revision before the currently selected revision (or divergent commit). Creates a new branch for merge commits.

Alt-P: reparenting Start a dialog to add/delete parents of the current revision.

Alt-Q: squash-into-parent Use jj squash to move the changes from the currently selected revision into its parent.

Alt-R: rebasing Start a dialog to configure the use of jj rebase to rebase a branch, source, or revision onto, before or after another revision.

Alt-S: restore-file EXPERIMENTAL: Start a dialog to select a file from the currently selected revision and use jj restore to restore the file into the working copy.

Alt-T: tag EXPERIMENTAL: Enter a tag name to create a new unsigned, annotated tag at the selected revision with git tag.

Alt-U: duplicate Use jj duplicate to duplicate the changes of the currently selected revision and make it the working-copy.

Alt-V: vivifydivergent When a revision has more than one visible commit, it becomes a divergent revision. This command uses jj new+squash … to create a new change_id for the currently selected divergent revision, effectively resolving the divergence.

Alt-W: squash-@-into Use jj squash to move the changes from the working copy into the currently selected revision.

Alt-X: swap-commits Use jj rebase --insert-before to quickly swap the currenly selected revision with the revision immediately before it.

Alt-Z: undo Use jj op undo to undo the last operation performed by jj that was not in itself undone or an undo operation.

Ctrl-↑: preview-up Scroll the preview window.

Ctrl-↓: preview-down Scroll the preview window.

Ctrl-A: author-reset Use jj describe --reset-author to reset the author and email of the currently selected revision.

Ctrl-D: describe Use jj describe to describe the currently selected revision.

Ctrl-E: edit-workspace Use jj {edit|new} to set the currently selected revision (or divergent commit) as the working-copy revision. Will create a new empty commit if the selected revision is immutable.

Ctrl-F: file-editor Use jj edit to switch to the currently selected revision and opens the files touched by this revision in $EDITOR.

Ctrl-H: help Show the jj-fzf help or browse the help descriptions of the currently seleected jj command in the jj help text.

Ctrl-L: log Use jj log to browse the history including patches, starting from the selected revision.

Ctrl-N: new Use jj new to create a new revision on top of the currently selected revision (or divergent commit).

Ctrl-O: op-log Use jj op log to browse the recent operations log. Use hotkeys to change the preview between diff, history and oplog entry mode. Undo the selected operation or restore its working copy into a new commit.

Ctrl-P: push-remote Use jj git fetch --all-remotes and jj git push --tracked to update the local and remote repositories. Pushing needs confirmation after a dry-run.

Ctrl-T: toggle-evolog Toggle the preview between jj evolution-log and change_id diff view.

Ctrl-U: clear-filter Discard the current fzf query string.

Ctrl-V: gitk Start gitk to browse the Git history of the repository.

Clone this wiki locally