Note
I'll be using unabbreviated commands here, many commands have shorthand versions and you can define your own aliases/scripts of course.
The requisite steps are:
- Create/move a bookmark
- Push that to your remote
- 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 PRbut tbh I just click the create PR link from jj git push most of the time.
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.
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.
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@).
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.
