JJ⚓︎
Basics⚓︎
Clone repository⚓︎
$ jj git clone [email protected]:Kristijan/notes.git
Fetching into new repo in "/Users/kristijan/Source/GitHub/No_GitButler/notes"
remote: Enumerating objects: 523, done.
remote: Total 523 (delta 22), reused 22 (delta 14), pack-reused 476 (from 2)
bookmark: gh-pages@origin [new] untracked
bookmark: main@origin [new] tracked
Setting the revset alias `trunk()` to `main@origin`
Working copy (@) now at: tmkzvtnw e447a693 (empty) (no description set)
Parent commit (@-) : mxtyyluq 33ef68d7 main | (empty) Merge pull request #51 from Kristijan/docs-add-vim-surround-notes
Added 21 files, modified 0 files, removed 0 files
Hint: Running `git clean -xdf` will remove `.jj/`!
Initialise existing repository⚓︎
$ jj git init
Done importing changes from the underlying Git repo.
Setting the revset alias `trunk()` to `main@origin`
Hint: The following remote bookmarks aren't associated with the existing local bookmarks:
feature/reporting@origin
main@origin
Hint: Run the following command to keep local bookmarks updated on future pulls:
jj bookmark track feature/reporting --remote=origin
jj bookmark track main --remote=origin
Initialized repo in "."
Hint: Running `git clean -xdf` will remove `.jj/`!
Describe change and push to remote⚓︎
$ jj desc -m "Updated log data"
$ jj bookmark set main -r @
Moved 1 bookmarks to lwoplyls 168e5e0a main* | Updated log data
$ jj
@ lwoplyls Kristian Milos 2026-02-02 15:16:23 main* 168e5e0a
│ Updated log data
○ oqlsvozy Kristian Milos 2026-02-02 15:14:23 1fb50dc2
│ Updated personal leave days
◆ rxooykyy Milos, Kristian 2026-01-20 08:28:16 main@origin 66e4d7be
│ Updating leave dates
~
$ jj git push
Changes to push to origin:
Move forward bookmark main from 66e4d7be2183 to 168e5e0ad5d7
remote: Resolving deltas: 100% (6/6), completed with 4 local objects.
Warning: The working-copy commit in workspace 'default' became immutable, so a new commit has been created on top of it.
Working copy (@) now at: ryszpory 24c7929f (empty) (no description set)
Parent commit (@-) : lwoplyls 168e5e0a main | Updated log data
If main is protected, push to a feature bookmark.
$ jj bookmark set feature/my-change -r @
Created 1 bookmarks pointing to lwoplyls 168e5e0a feature/my-change main | Updated log data
$ jj bookmark track feature/my-change --remote=origin
Started tracking 1 remote bookmarks.
$ jj git push -b feature/my-change
You can now rebase your current changes from main if you want to see a liniar history, without the PR merge commit showing branched off.
Rebase changes from remote⚓︎
jj git fetch
jj rebase --onto main@origin
jj commit -m "Rebased onto origin/main"
jj git push -b main
This assumes you're rebasing @ onto main@origin. You can specify a different change with jj rebase -r @ -d main@origin (where @ is the change you want to rebase onto main@origin)
Log⚓︎
See more history⚓︎
or
Bookmarks⚓︎
Create a bookmark⚓︎
$ jj bookmark set feature/my-change -r @
Created 1 bookmarks pointing to lwoplyls 168e5e0a feature/my-change main | Updated log data