Skip to content

Git command table

Note that all jj commands can be run on any commit (not just the working-copy commit), but that’s left out of the table to keep it simple. For example, jj squash -r <revision> will move the diff from that revision into its parent.

Use caseGit commandJujutsu commandNotes
Create a new repogit initjj git init [--no-colocate]
Clone an existing repogit clone <source> <destination> [--origin <remote name>]jj git clone <source> <destination> [--remote <remote name>]There is no support for cloning non-Git repos yet.
Update the local repo with all bookmarks/branches from a remotegit fetch [<remote>]jj git fetch [--remote <remote>]There is no support for fetching into non-Git repos yet.
Update a remote repo with all bookmarks/branches from the local repogit push --all [<remote>]jj git push --all [--remote <remote>]There is no support for pushing from non-Git repos yet.
Update a remote repo with a single bookmark from the local repogit push <remote> <bookmark name>jj git push --bookmark <bookmark name> [--remote <remote>]There is no support for pushing from non-Git repos yet.
Add a remote target to the repogit remote add <remote> <url>jj git remote add <remote> <url>
Show summary of current work and repo statusgit statusjj st
Show diff of the current changegit diff HEADjj diff
Show diff of another changegit diff <revision>^ <revision>jj diff -r <revision>
Show diff from another change to the current changegit diff <revision>jj diff --from <revision>
Show diff from change A to change Bgit diff A Bjj diff --from A --to B
Show all the changes in A..Bgit diff A...Bjj diff -r A..B
Show description and diff of a changegit show <revision>jj show <revision>
Add a file to the current changetouch filename; git add filenametouch filename
Remove a file from the current changegit rm filenamerm filename
Remove a previously tracked file from the current change, but keep it in the working copygit rm --cached filenamejj file untrack filenameFile name must match an ignore pattern to remain untracked. See the documentation for working copies for more.
Modify a file in the current changeecho stuff >> filenameecho stuff >> filename
Finish work on the current change and start a new changegit commit -ajj commit
See compact log graph of ancestors of the current commitgit log --oneline --graphjj log -r ::@
See compact log graph of all reachable commitsgit log --oneline --graph --alljj log -r 'all()' or jj log -r ::In a Git-backed Jujutsu repository the Git command will also show all commits preserved by Jujutsu, including hidden commits. To exclude all commits only preserved by Jujutsu, replace --all by --exclude refs/jj/* --all. This will also exclude the Jujutsu-reachable commits though, if they are not Git-reachable.
Show compact log graph of commits not on the main branchgit log --oneline --graph --branches --not upstream/mainjj log
Show log of commits that have the string "stuff" in the changed linesgit log -G stuffjj log -r 'diff_contains(stuff)'
List versioned files in the working copygit ls-files --cachedjj file list
Search among files versioned in the repositorygit grep foogrep foo $(jj file list) or rg --no-require-git foo
Abandon the current change and start a new changegit reset --hard (cannot be undone)jj abandon
Make the current change emptygit reset --hard (same as abandoning a change since Git has no concept of a "change")jj restore
Abandon the parent of the working copy, but keep its diff in the working copygit reset --soft HEAD~jj squash --from @-
Discard working copy changes in some filesgit restore <paths>... or git checkout HEAD -- <paths>...jj restore <paths>...
Edit description (commit message) of the current changeNot supportedjj describe
Edit description (commit message) of the previous changegit commit --amend --onlyjj describe @-
Edit description (commit message) of any changegit commit --fixup=reword:X; git rebase --autosquash X^jj describe X
Temporarily put away the current changegit stashjj new @-The old working-copy commit remains as a sibling commit. The old working-copy commit X can be restored with jj edit X.
Start working on a new change based on the
bookmark/branch
git switch -c topic main or git checkout -b topic main (may need to stash or commit first)jj new main
Merge branch A into the current changegit merge Ajj new @ A
Check out a named revision (or branch) to examine sourcegit checkout v1.0.1jj new v1.0.1Creates new empty change on top (see jj new main)
Move bookmark/branch A onto bookmark/branch Bgit rebase B A (may need to rebase other descendant branches separately)jj rebase -b A -o B
Move change A and its descendants onto change Bgit rebase --onto B A^ <some descendant bookmark> (may need to rebase other descendant bookmarks separately)jj rebase -s A -o B
Reorder changes from A-B-C-D to A-C-B-Dgit rebase -i Ajj rebase -r C --before B
Move the diff in the current change into the parent changegit commit --amend -ajj squash
Interactively move part of the diff in the current change into the parent changegit add -p; git commit --amendjj squash -i
Move the diff in the working copy into an ancestorgit commit --fixup=X; git rebase --autosquash X^jj squash --into X
Interactively move part of the diff in an arbitrary change to another arbitrary changeNot supportedjj squash -i --from X --into Y
Interactively split the changes in the working copy in twogit commit -pjj split
Interactively split an arbitrary change in twoNot supported (can be emulated with the "edit" action in git rebase -i)jj split -r <revision>
Interactively edit the diff in a given changeNot supported (can be emulated with the "edit" action in git rebase -i)jj diffedit -r <revision>
Resolve conflicts and continue interrupted operationecho resolved > filename; git add filename; git rebase/merge/cherry-pick --continueecho resolved > filename; jj squashOperations don't get interrupted, so no need to continue.
Create a copy of a commit on top of another commitgit co <destination>; git cherry-pick <source>jj duplicate <source> -o <destination>
Find the root of the working copy (or check if in a repo)git rev-parse --show-topleveljj workspace root
List bookmarks/branchesgit branchjj bookmark list or jj b l for short
Create a bookmark/branchgit branch <name> <revision>jj bookmark create <name> -r <revision>
Move a bookmark/branch forwardgit branch -f <name> <revision>jj bookmark move <name> --to <revision> or jj b m <name> -t <revision> for short
Move a bookmark/branch backward or sidewaysgit branch -f <name> <revision>jj bookmark move <name> --to <revision> --allow-backwards
Delete a bookmark/branchgit branch --delete <name>jj bookmark delete <name>
See log of operations performed on the repoNot supportedjj op log
Undo the last operationNot supportedjj undoThere is also a matching jj redo command to redo the most recently undone operation.
Revert an earlier operationNot supportedjj op revert
Create a commit that cancels out a previous commitgit revert <revision>jj revert -r <revision> -B @
Show what revision and author last modified each line of a filegit blame <file>jj file annotate <path>