Skip to main content

Git to jj Cheat Sheet

If you are coming from Git, adapting to Jujutsu (jj) is straightforward. Many concepts are similar, but jj removes a lot of boilerplate (like staging) and introduces powerful new workflows (like stable change IDs).

Repository Setup

ActionGit Commandjj Command
Init a repogit initjj git init
Clone a repogit clone <url>jj git clone <url>
View statusgit statusjj status

Committing Changes

In jj, you do not need to stage files. Your working copy is automatically treated as an active change.
ActionGit Commandjj Command
Stage filesgit add <file>(Not needed)
Commit changesgit commit -m "msg"jj describe -m "msg"
Amend commitgit commit --amendjj describe -m "new msg"
Discard working changesgit restore .jj restore

Branching (Bookmarks)

jj calls branches “bookmarks”. Unlike Git, establishing your working copy does not require “checking out” a branch; you simply move your working copy to a change.
ActionGit Commandjj Command
Create a branchgit branch <name>jj bookmark create <name>
Switch branchesgit checkout <name>jj new <name>
Move branch pointergit branch -f <name>jj bookmark set <name> -r @
List branchesgit branchjj bookmark list
Delete a branchgit branch -d <name>jj bookmark delete <name>

History and Logging

jj tracks history as a tree of changes. The @ symbol represents your current working copy.
ActionGit Commandjj Command
View historygit log --graphjj log
View diffgit diffjj diff
View specific commitgit show <hash>jj show <change-id>

Remote Synchronization

JJ bridges with Git remotes natively.
ActionGit Commandjj Command
Fetch changesgit fetchjj git fetch
Push branchesgit pushjj git push --all
Push specific branchgit push origin <name>jj git push --bookmark <name>

Tip: jj tracks every operation. Made a mistake? Just run jj undo to safely revert any jj command.