Skip to content

Commit 3a1d662

Browse files
docs: Create jj commands table and add to website
1 parent 6cbb21f commit 3a1d662

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

docs/jj-commands-table.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
| Command & Example | Description | Example Usage |
2+
|----------------------------------------------------|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
3+
| `jj git init` | Initialize a Git-backed repository with jj | `jj git init` |
4+
| `jj clone <repo-url>` | Clone a remote repository (using Git, then initialize jj) | ```bash git clone <https://github.com/user/repo.git> cd repo jj git init``` |
5+
| `jj file track .` | Track files in the current directory | `jj file track .` |
6+
| `jj commit -m "message"` | Commit current changes with a message | `jj commit -m "Initial commit"` |
7+
| `jj new` | Create a new commit for the next change | `jj new` |
8+
| `jj describe -m "description"` | Set or change commit description | `jj describe -m "Refactored login flow"` |
9+
| `jj git remote add origin <repo-url>` | Add a remote repository | `jj git remote add origin https://github.com/user/repo.git` |
10+
| `jj git push -c @-` | Push the parent of the working copy commit to remote | `jj git push -c @-` |
11+
| `jj bookmark create <name>` | Create a named bookmark (branch) | `jj bookmark create foo` |
12+
| `jj git push --allow-new` | Push new bookmarks to remote | `jj git push --allow-new` |
13+
| `jj status` | Show status of working copy and current commit | `jj status` |
14+
| `jj diff` | Show differences between commits | `jj diff` |
15+
| `jj log` | Show commit history | `jj log` |
16+
| `jj git fetch` | Fetch changes from the default remote | `jj git fetch` |
17+
| `jj git fetch --remote origin` | Fetch changes from a specific remote | `jj git fetch --remote origin` |
18+
| `jj git fetch --all-remotes` | Fetch changes from all configured remotes | `jj git fetch --all-remotes` |
19+
| `jj bookmark list` | List all local bookmarks | `jj bookmark list` |
20+
| `jj bookmark list --all-remotes` | List all local and remote bookmarks | `jj bookmark list --all-remotes` |
21+
| `jj edit <bookmark-name>` | Switch working copy to a different bookmark | `jj edit main` |
22+
| `jj edit <bookmark-name> --ignore-immutable` | Switch to a bookmark, bypassing immutability | `jj edit main --ignore-immutable` |
23+
| `jj bookmark set <name> -r <revision>` | Set a bookmark to point to a specific revision | `jj bookmark set foo -r abc123` |
24+
| `jj bookmark rename <old-name> <new-name>` | Rename a bookmark | `jj bookmark rename foo boo` |
25+
| `jj bookmark delete <bookmark-name>` | Delete a bookmark and mark for remote deletion | `jj bookmark delete foo` |
26+
| `jj bookmark delete glob:*` | Delete all bookmarks (using wildcard) | `jj bookmark delete glob:*` |
27+
| `jj bookmark forget <bookmark-name>` | Delete a local bookmark without affecting remote | `jj bookmark forget foo` |
28+
| `jj bookmark forget glob:*` | Forget all local bookmarks without remote deletion | `jj bookmark forget glob:*` |
29+
| `jj bookmark track <bookmark>@origin` | Start tracking a remote bookmark locally | `jj bookmark track main@origin` |
30+
| `jj abandon <revset>` | Abandon (delete) specified commits/revisions | `jj abandon abc123` |
31+
| `jj abandon "root()..@" --ignore-immutable` | Abandon all commits from root to current, bypassing immutability | `jj abandon "root()..@" --ignore-immutable` |
32+
| `jj rebase -b <bookmark> -d <destination>` | Rebase a bookmark onto a destination bookmark/commit | `jj rebase -b foo -d main` |
33+
| `jj git push --bookmark <name>` | Push a specific bookmark to the remote | `jj git push --bookmark foo` |
34+
| `jj git push --deleted` | Push bookmark deletions to the remote | `jj git push --deleted` |
35+
| `jj git push --bookmark <name> --force` | Force-push a bookmark to overwrite remote history | `jj git push --bookmark foo --force` |
36+
| `jj resolve <file-name>` | Resolve conflicts in a file using a merge tool | `jj resolve main.py` |
37+
| `jj resolve <file-name> --tool :ours` | Resolve conflict by accepting one side (ours) | `jj resolve main.py --tool :ours` |
38+
| `jj resolve <file-name> --tool :theirs` | Resolve conflict by accepting the other side (theirs) | `jj resolve main.py --tool :theirs` |
39+
| `jj squash` | Incorporate conflict resolution into the current commit | `jj squash` |
40+
| `jj undo` | Undo the last operation | `jj undo` |
41+
| `jj op log` | Show operation history for potential recovery | `jj op log` |
42+
| `jj op restore <operation-id>` | Restore repository state to a previous operation | `jj op restore 12345678` |
43+
| `jj config get revset-aliases."immutable_heads()"` | Check immutable commits configuration | `jj config get revset-aliases."immutable_heads()"` |
44+
| `jj config set --user ui.merge-editor <tool>` | Set a custom merge editor for conflict resolution | `jj config set --user ui.merge-editor meld` |

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ nav: # This lists all the files that become part of the documentation
120120
- FAQ: 'FAQ.md'
121121

122122
- CLI reference: 'cli-reference.md'
123+
- JJ Commands Table: 'jj-commands-table.md'
123124

124125
- Testimonials: 'testimonials.md'
125126

0 commit comments

Comments
 (0)