Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Installation and setup

There are many ways to install Jujutsu and the best one depends on your system. If you don't care at all about how Jujutsu is installed, you can copy-paste these commands:

curl https://mise.run | sh
~/.local/bin/mise install-into jujutsu@latest /tmp/jj-install
mv /tmp/jj-install/jj ~/.local/bin
rm -rf /tmp/jj-install
exec $SHELL --login

Now run jj --version to verify the installation. It should print the currently installed version of Jujutsu, something like jj 0.33.0-blabla. If the output is an error instead, e.g. bash: jj: command not found..., open the text box below.

jj: command not found...

Your system probably doesn't add the installation directory ~/.local/bin to the PATH environment variable. To fix that, you first need to figure out what shell you're using:

echo $SHELL

The output should end with either "bash", or "zsh". That's your shell. Next, put a command adding ~/.local/bin to your PATH variable into your shell's startup script:

# for bash:
echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
# for zsh:
echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.zshrc

Lastly, close the terminal and open a new one so the changes take effect.

Explanation of installation commands

Installing software is more difficult than one might think. It depends on many factors like CPU architecture and operating system. That's why there's not a single, easy command we can run to install Jujutsu on any system. Instead, we first install another program that specializes in installing software called mise. (You can read more about mise on its website.) The first command curl https://mise.run | sh downloads and runs a script from the internet that installs mise for you. This is kind of dangerous and you should be careful when executing scripts from the internet. People could place malicious commands in the script you're downloading. But it's a convenient technique if you trust the owner of the website you're loading the script from.

The second command runs mise to download Jujutsu into a temporary directory. We have to specify the full path to the mise binary (~/.local/bin/mise), because at this point we don't know if ~/.local/bin is included in your PATH variable. (See the "Terminal basics" chapter for an explanation of that.) mise takes care of downloading the right binary for your operating system and CPU architecture.

The following command moves the downloaded binary to ~/.local/bin, which is the customary place for user-local programs. rm -rf /tmp/jj-install ("remove recursive force") deletes the temporary download directory and its content.

Lastly, exec $SHELL --login restarts your shell, which causes its startup scripts to run again. Some Linux distributions like Ubuntu only add ~/.local/bin to the PATH variable if that directory exists when the terminal is started. So, restarting the terminal after installing Jujutsu is a simple way to make sure the system will find the new program.

Maybe there are distributions which don't add ~/.local/bin to PATH at all, which would mean those commands don't work on such a system. I'm not aware of such distributions. (Please open an issue if you know of a relevant one!) You can fix such an issue for yourself by extending the PATH variable in your shell startup script.

Other installation methods

The official installation instructions for several different platforms are here. I will mention a few methods that I consider important as well.

If you use cargo-binstall, this works great:

cargo-binstall jj-cli

If you're a Mac & Homebrew user, this one's for you:

brew install jj

If you have the Rust toolchain installed and would like to compile from source, you can run:

cargo install --locked --bin jj jj-cli

You can also download a binary directly from Jujutsu's release page. Scroll down to "Assets", there is a list of archives to download. The right one depends on two things: your operating system and your CPU architecture. Look for the strings matching your system in the names of the archives.

How to identify your operating system:

operating systemstring to look for
Linuxunknown-linux-musl
Macapple-darwin
Windowspc-windows-msvc

How to identify your CPU architecture:

CPU brandstring to look for
Intelx86_64
AMDx86_64
Appleaarch64
ARMaarch64
Qualcom (Snapdragon)aarch64

Once you have downloaded the right archive, you need to extract it. You should be able to right-click on the downloaded archive in your file explorer and select "extract" or something similar in the drop-down. The extracted folder will contain documentation and a file called "jj". You need to move that into the directory ~/.local/bin/. (Or another location where you keep your programs if you know what you're doing.)

Initial configuration

Jujutsu is very configurable, but we don't care about most knobs and dials right now. The only thing that you must configure is your name and email. This is required metadata and some things won't work right without this information. However, you don't have to enter your real name and email, in case you're not comfortable storing that information in the repositories you're planning to work on.

If you're working on school or work projects, it's probably fine to configure your real name and school / work email. These repositories are usually not publicly accessible.

If you're planning to work on open source projects that anyone can see, you may want to be more careful. You could use your GitHub handle as username, but many are comfortable using their real name too. The email address is more important. If you use your normal, private email address, there is a risk of receiving undesirable emails at that address. You might consider using a dedicated address just for open source work. Another alternative is to use an address provided by GitHub. It identifies your GitHub account, but you cannot receive emails through it. Go to GitHub's email settings and select "Keep my email address private", your private email address will then be shown at the top.

Here are the commands to configure your username and email:

jj config set --user user.name "Anonymous"
jj config set --user user.email "anon@local"

If you want shell completions, follow the instructions here. If you don't know what a "shell completion" is, don't worry, it's not important.

Two flavors of repositories

Jujutsu can create repositories in two slightly different flavors: "colocated" and "non-colocated". For newcomers like you, the "colocated" flavor is the better choice. Run the following command to configure it as the default:

jj config set --user git.colocate true

I won't explain the difference, it doesn't matter to you. Colocated repos will become the default in Jujutsu version 0.34 anyway, at which point I can just remove this info box.

Installing a simple text editor

Jujutsu will sometimes ask you to edit a text file. The default text editor used for that purpose is nano on Linux and Mac. It works fine, but it can be counter-intuitive for new users. (Ctrl+O is saving the file and Ctrl+X is closing the program.)

This is optional, but I recommend you install a text editor called edit. I consider it to be the simplest and most intuitive alternative. If you installed Jujutsu with mise (as suggested above) you can also install edit the same way:

mise install-into edit@latest /tmp/edit-install
mv /tmp/edit-install/edit ~/.local/bin
rm -rf /tmp/edit-install

If you installed Jujutsu using another method, you'll want to install edit on your own as well.

Next, we need to configure Jujutsu to use edit when opening a text file:

jj config set --user ui.editor edit

From now on, when Jujutsu opens a text file for you, it will do so using edit. When you're done editing a file, click on "File", then "Exit", in the menu bar or press Ctrl+Q to exit the text editor. It will ask you if you want to save the file, which you confirm by pressing Enter. That's it! I will remind you how it works the first time we need it.