Init some git-based project:
cargo init --bin something
Colocate jj:
jj init --colocate
Next, make whatever setup changes you want to make to the project as part of its initial/first commit. Whatever you do, this will be part of the first commit pushed to remote.
When ready, save your initial commit:
jj commit -m "setup repo"
Next, add origin:
jj git remote add origin [email protected]:somewhere/something.git
Then, create a new bookmark with the same name as your default branch. In my case, I use trunk
:
jj b c trunk -r @-
The above sets trunk
to point to the revset at @-
, which is the revset associated with the "setup repo"
commit from earlier. (In jj they’re called revsets
, not commits).
Finally, push trunk
up to origin
:
jj git push --allow-new
Done!