diff --git a/docs/misc/vcs/jj.md b/docs/misc/vcs/jj.md new file mode 100644 index 0000000..27c6aa1 --- /dev/null +++ b/docs/misc/vcs/jj.md @@ -0,0 +1,62 @@ +# Jujustsu (`jj`) + +## Common Commands + +### Status & Log + +`jj status`: show current status of the working copy +`jj log -r|--revisions `: show commits of a given revset +`jj log -r|--revisions ::@`: show all ancestors of the working copy + +### Showing Changes + +`jj show []`: show changes in ``, compared to its parents +`jj diff [-f|--from ] [-t|--to ]`: compare file contents between revisions + +### Describing & Creating Commits + +`jj describe -m|--message `: add a description to the working copy +`jj new -m|--message `: create a new commit after `` with the given description +`jj commit -m|--message `: create and describe a new commit in a single command + +### Deleting Commits + +`jj abandon `: delete the revision `` + +### Merging Commits + +`jj new ...`: create a new commit after listed parents + +### Rebasing Commits + +`jj rebase --source --destination `: rebase `` and descendants onto `` +`jj rebase --source --insert-after|--after `: insert `` and descendants after `` +`jj rebase --source --insert--before|--before `: insert `` and descendants before `` + +### Squashing & Splitting Commits + +`jj squash [-i|--interactive]`: move changes from current revision (`@`) into its parent +`jj squash -f|--from --t|--to|--into `: move changes from `` into `` + +`jj split [-i|--interactive]`: split a revision in two + +### Signing Commits + +`jj sign --key -r|--revisions `: cryptographically sign a revision + +### Managing Bookmarks + +`jj bookmark set -r|--revision|--to `: create or update a bookmark to point to a certain commit +`jj bookmark move -r|--revision|--to [--allow-backwards]`: move bookmark `` to point to `` +`jj bookmark create -r|--revision|--to `: create `` pointing to `` + +## Git Commands + +`jj git init --colocate`: init a colocated jj/git repository +`jj git fetch`: fetch changes from the remote git repository +`jj git push`: push changes to git + +## Operations + +`jj undo []`: undo an operation +`jj operation log`: show list of operations taken diff --git a/mkdocs.yml b/mkdocs.yml index 305d39e..f471a35 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -186,6 +186,7 @@ nav: - Misc: - VCS: - Git: misc/vcs/git.md + - JJ: misc/vcs/jj.md - GraphQL: misc/graph-ql.md - RegEx: misc/regular-expressions.md - SSH: misc/ssh.md