- Use case: Create a new repo Git command: > `git init` Jujutsu command: > `jj git init [--colocate]` Notes: '' - Use case: Clone an existing repo Git command: > `git clone [--origin ]` Jujutsu command: > `jj git clone [--remote ]` Notes: There is no support for cloning non-Git repos yet. # TODO: Mention that you might need to do a `jj bookmark track branch@remote` to see the # bookmark in `jj log`. - Use case: Update the local repo with all bookmarks/branches from a remote Git command: > `git fetch []` Jujutsu command: > `jj git fetch [--remote ]` Notes: There is no support for fetching into non-Git repos yet. # TODO: This only affects tracked branches now. - Use case: Update a remote repo with all bookmarks/branches from the local repo Git command: > `git push --all []` Jujutsu command: > `jj git push --all [--remote ]` Notes: There is no support for pushing from non-Git repos yet. - Use case: Update a remote repo with a single bookmark from the local repo Git command: > `git push ` Jujutsu command: > `jj git push --bookmark [--remote ]` Notes: There is no support for pushing from non-Git repos yet. - Use case: Add a remote target to the repo Git command: > `git remote add ` Jujutsu command: > `jj git remote add ` Notes: '' - Use case: Show summary of current work and repo status Git command: > `git status` Jujutsu command: > `jj st` Notes: '' - Use case: Show diff of the current change Git command: > `git diff HEAD` Jujutsu command: > `jj diff` Notes: '' - Use case: Show diff of another change Git command: > `git diff ^ ` Jujutsu command: > `jj diff -r ` Notes: '' - Use case: Show diff from another change to the current change Git command: > `git diff ` Jujutsu command: > `jj diff --from ` Notes: '' - Use case: Show diff from change A to change B Git command: > `git diff A B` Jujutsu command: > `jj diff --from A --to B` Notes: '' - Use case: Show all the changes in A..B Git command: > `git diff A...B` Jujutsu command: > `jj diff -r A..B` Notes: '' - Use case: Show description and diff of a change Git command: > `git show ` Jujutsu command: > `jj show ` Notes: '' - Use case: Add a file to the current change Git command: > `touch filename; git add filename` Jujutsu command: > `touch filename` Notes: '' - Use case: Remove a file from the current change Git command: > `git rm filename` Jujutsu command: > `rm filename` Notes: '' - Use case: Modify a file in the current change Git command: > `echo stuff >> filename` Jujutsu command: > `echo stuff >> filename` Notes: '' - Use case: Finish work on the current change and start a new change Git command: > `git commit -a` Jujutsu command: > `jj commit` Notes: '' - Use case: See log of ancestors of the current commit Git command: > `git log --oneline --graph --decorate` Jujutsu command: > `jj log -r ::@` Notes: '' - Use case: See log of all reachable commits Git command: > `git log --oneline --graph --decorate --branches` Jujutsu command: > `jj log -r 'all()'` or `jj log -r ::` Notes: '' - Use case: Show log of commits not on the main branch Git command: (TODO) Jujutsu command: > `jj log` Notes: '' - Use case: List versioned files in the working copy Git command: > `git ls-files --cached` Jujutsu command: > `jj file list` Notes: '' - Use case: Search among files versioned in the repository Git command: > `git grep foo` Jujutsu command: > `grep foo $(jj file list)` or `rg --no-require-git foo` Notes: '' - Use case: Abandon the current change and start a new change Git command: > `git reset --hard` (cannot be undone) Jujutsu command: > `jj abandon` Notes: '' - Use case: Make the current change empty Git command: > `git reset --hard` (same as abandoning a change since Git has no concept of a "change") Jujutsu command: > `jj restore` Notes: '' - Use case: Abandon the parent of the working copy, but keep its diff in the working copy Git command: > `git reset --soft HEAD~` Jujutsu command: > `jj squash --from @-` Notes: '' - Use case: Discard working copy changes in some files Git command: > `git restore ...` or `git checkout HEAD -- ...` Jujutsu command: > `jj restore ...` Notes: '' - Use case: Edit description (commit message) of the current change Git command: Not supported Jujutsu command: > `jj describe` Notes: '' - Use case: Edit description (commit message) of the previous change Git command: > `git commit --amend --only` Jujutsu command: > `jj describe @-` Notes: '' - Use case: Temporarily put away the current change Git command: > `git stash` Jujutsu command: > `jj new @-` Notes: > The old working-copy commit remains as a sibling commit. The old working-copy commit X can be restored with `jj edit X`. - Use case: Start working on a new change based on the
bookmark/branch Git command: > `git switch -c topic main` or `git checkout -b topic main` (may need to stash or commit first) Jujutsu command: > `jj new main` Notes: '' - Use case: Merge branch A into the current change Git command: > `git merge A` Jujutsu command: > `jj new @ A` Notes: '' - Use case: Move bookmark/branch A onto bookmark/branch B Git command: > `git rebase B A` (may need to rebase other descendant branches separately) Jujutsu command: > `jj rebase -b A -d B` Notes: '' - Use case: Move change A and its descendants onto change B Git command: > `git rebase --onto B A^ ` (may need to rebase other descendant bookmarks separately) Jujutsu command: > `jj rebase -s A -d B` Notes: '' - Use case: Reorder changes from A-B-C-D to A-C-B-D Git command: > `git rebase -i A` Jujutsu command: > `jj rebase -r C --before B` Notes: '' - Use case: Move the diff in the current change into the parent change Git command: > `git commit --amend -a` Jujutsu command: > `jj squash` Notes: '' - Use case: Interactively move part of the diff in the current change into the parent change Git command: > `git add -p; git commit --amend` Jujutsu command: > `jj squash -i` Notes: '' - Use case: Move the diff in the working copy into an ancestor Git command: > `git commit --fixup=X; git rebase -i --autosquash X^` Jujutsu command: > `jj squash --into X` Notes: '' - Use case: Interactively move part of the diff in an arbitrary change to another arbitrary change Git command: Not supported Jujutsu command: > `jj squash -i --from X --into Y` Notes: '' - Use case: Interactively split the changes in the working copy in two Git command: > `git commit -p` Jujutsu command: > `jj split` Notes: '' - Use case: Interactively split an arbitrary change in two Git command: > Not supported (can be emulated with the "edit" action in `git rebase -i`) Jujutsu command: > `jj split -r ` Notes: '' - Use case: Interactively edit the diff in a given change Git command: > Not supported (can be emulated with the "edit" action in `git rebase -i`) Jujutsu command: > `jj diffedit -r ` Notes: '' - Use case: Resolve conflicts and continue interrupted operation Git command: > `echo resolved > filename; git add filename; git rebase/merge/cherry-pick --continue` Jujutsu command: > `echo resolved > filename; jj squash` Notes: Operations don't get interrupted, so no need to continue. - Use case: Create a copy of a commit on top of another commit Git command: > `git co ; git cherry-pick ` Jujutsu command: > `jj duplicate -d ` Notes: '' - Use case: Find the root of the working copy (or check if in a repo) Git command: > `git rev-parse --show-toplevel` Jujutsu command: > `jj workspace root` Notes: '' - Use case: List bookmarks/branches Git command: > `git branch` Jujutsu command: > `jj bookmark list` or `jj b l` for short Notes: '' - Use case: Create a bookmark/branch Git command: > `git branch ` Jujutsu command: > `jj bookmark create -r ` Notes: '' - Use case: Move a bookmark/branch forward Git command: > `git branch -f ` Jujutsu command: > `jj bookmark move --to ` or `jj b m --to ` for short Notes: '' - Use case: Move a bookmark/branch backward or sideways Git command: > `git branch -f ` Jujutsu command: > `jj bookmark move --to --allow-backwards` Notes: '' - Use case: Delete a bookmark/branch Git command: > `git branch --delete ` Jujutsu command: > `jj bookmark delete ` Notes: '' - Use case: See log of operations performed on the repo Git command: Not supported Jujutsu command: > `jj op log` Notes: '' - Use case: Undo an earlier operation Git command: Not supported Jujutsu command: > `jj [op] undo ` Notes: > `jj undo` is an alias for `jj op undo`. - Use case: Create a commit that cancels out a previous commit Git command: > `git revert ` Jujutsu command: > `jj backout -r ` Notes: '' - Use case: Show what revision and author last modified each line of a file Git command: > `git blame ` Jujutsu command: > `jj file annotate ` Notes: ''