Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 1.5 KB

github_workflows.md

File metadata and controls

55 lines (40 loc) · 1.5 KB

GitHub Workflows

Setting up GH in non-colocated repos

If you are using "pure" jj (e.g. not using jj git init --colocate or jj clone --colocate) then gh won't work out of the box because it can't find the .git repo. You can fix that by setting up the GIT_DIR environment variable.

export GIT_DIR="$PWD.jj/repo/store/git"

Setting up a remote for a forked repo

Assuming you've configured GIT_DIR, you can use the gh CLI to create a fork:

gh repo fork

By default (without other args), this will change the original origin to be named upstream and create a new remote named origin that points to your fork. Now we have two remotes (origin and upstream), and we need to ensure that both are fetched when we run future jj git fetch operations:

jj config set --repo git.fetch '["origin", "upstream"]'

Now we need to fetch everything:

jj git fetch

jj is already tracking main@origin (from our original jj git clone), but that now points at our fork. We need instruct jj to track main@upstream also now:

jj bookmark track main@upstream

I also like to update trunk() to point at the "real" trunk (aka on upstream):

jj config set --repo revset-aliases.'"trunk()"' 'main@upstream'