Skip to content

Instantly share code, notes, and snippets.

@tombl
Last active December 30, 2025 15:24
Show Gist options
  • Select an option

  • Save tombl/16249f55fd248c455d9ec0eb432c63d6 to your computer and use it in GitHub Desktop.

Select an option

Save tombl/16249f55fd248c455d9ec0eb432c63d6 to your computer and use it in GitHub Desktop.
jj notes

Note

I'll be using unabbreviated commands here, many commands have shorthand versions and you can define your own aliases/scripts of course.

how do I create a GitHub PR?

The requisite steps are:

  1. Create/move a bookmark
  2. Push that to your remote
  3. Open the PR

The best way to do this is

jj git push --named my-bookmark=@ # creates/moves a bookmark to @, pushes it to the remote
gh pr create -H (jj log -r@ --no-graph -Tbookmarks) # gets the name of the bookmark at @, creates a PR

but tbh I just click the create PR link from jj git push most of the time.

what does jj git push actually do

jj has this concept of "revsets" which is a query language for commits.

jj git push without qualifiers (like -b, -c, or -r) defaults to the revset remote_bookmarks(remote=exact:origin)..@, which lists every remote bookmark between the start of the repo and @ that has changes.

Here's what that looks like: image

checking out other people's work

jj git fetch && jj new the-branch@origin to "checkout" a branch for review. This will disappear from your log once you set @ to something else.

jj git fetch && jj bookmark track the-branch@origin && jj new the-branch if you intend on that bookmark/branch persisting in your jj log after you're done with it.

workspaces

Because jj has no index, your workspaces are all just commits, so you can combine two workspaces just like you combine two branches. You either rebase them (jj rebase --branch workspace@ --onto default@), squash them together (jj squash --from workspace@ --into default@), or make a merge commit (jj new workspace@ default@).

a note on tooling

Before I used jj I just used the git cli, no extra tools. But jj requires you to type outtab complete commit hashes pretty often, so I've found that I'm faster with jjui, which is a really great TUI. Its functionality maps 1:1 to the cli so I like it more than the git GUIs that try to do too much.

Also I'm keeping my eye on https://github.com/dmmulroy/jj-ryu which is WIP but tries to get the Graphite gt UX on top of jj and GitHub.

Also while you're here Mergiraf is great for dealing with 50% of merge conflicts and is preconfigured in jj, you just need to install it.

jj resolve --tool mergiraf deals with half my merge conflicts, then jj resolve --tool vscode for sorting out the other half.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment