LinuxCommandLibrary

jj

Manage code revisions

TLDR

Update description of the revisions specified by given revsets (e.g. B::D, A..D, B|C|D, etc.)

$ jj [[desc|describe]] [[-m|--message]] "[message]" [[-r|--revision]] [revsets]
copy

Create a new commit/revision on top of a given revision
$ jj new [revset]
copy

Create a new merge commit on top of multiple revisions
$ jj new [revset1 revset2 ...]
copy

Update the working copy to point to a revision
$ jj edit [revset]
copy

Undo the previous command (which may itself have been undo)
$ jj undo
copy

Execute a jj subcommand without snapshotting the working copy
$ jj --ignore-working-copy [subcommand]
copy

Execute a jj subcommand at an operation
$ jj [[--at-op|--at-operation]] [operation] [subcommand]
copy

Display help for a specific subcommand (like new, commit, desc, etc.)
$ jj help [subcommand]
copy

SYNOPSIS

jj
[GLOBAL_OPTIONS]
<SUBCOMMAND>
[SUBCOMMAND_OPTIONS]
[ARGS...]

PARAMETERS

init
    Initializes a new Jujutsu repository.

status
    Shows the current repository status and changes.

log
    Displays the commit history.

diff
    Shows changes between commits or the working copy.

commit
    Records changes to the repository.

branch
    Manages branches in the repository.

checkout
    Switches to a different commit or branch.

rebase
    Rebases a commit or set of commits onto another.

squash
    Combines the current commit with its parent.

undo
    Reverts the last operation.

push
    Updates remote Git repositories with local changes.

pull
    Fetches changes from remote Git repositories.

DESCRIPTION

Jujutsu (jj) is a modern, Git-compatible distributed version control system designed for a more intuitive and efficient developer experience. It aims to simplify complex version control operations by providing a different, often simpler, mental model than Git. Key features include a mutable history (changes are always applied as new commits, but old commits can be rewritten implicitly), a powerful operation log for easy undoing of actions, and rebase-by-default workflows. While offering a unique command-line interface, Jujutsu operates on standard Git repositories, ensuring full interoperability with existing Git tools and services. It prioritizes local workflow efficiency and aims to make tasks like rebasing, amending, and splitting commits more straightforward.

CAVEATS

Jujutsu (jj) is not a standard command pre-installed on most Linux distributions; it must be installed separately. Its command structure and mental model differ significantly from Git, which can require a learning curve for experienced Git users. As a relatively new project, it is still under active development, and its API and features may evolve.

<B>KEY FEATURES</B>


Mutable History: Allows seamless rewriting of past commits without explicit rebase commands.
Operation Log: Provides a robust `jj undo` command to revert any previous operation.
Rebase by Default: Encourages linear history by automatically rebasing local changes.
Git Compatibility: Works on top of standard Git repositories, ensuring interoperability.

HISTORY

Jujutsu (jj) was created by Martin von Zweigbergk, with its first public release and increasing adoption around 2021-2022. It emerged from a desire to address the complexities and limitations of Git's user interface, aiming to provide a more intuitive and powerful tool for daily version control tasks. Its development focuses on a clean conceptual model and efficient local workflows.

SEE ALSO

git(1), hg(1)

Copied to clipboard