Julia provides the standard way to develop a package, which is dev Pkg
, automatically cloning the repository into .julia/dev/
. However, when one does this with a package one do not own, how is the proper way to proceed?
Currently I'm skipping the automatic clone given by dev Pkg
and first forking it, then cloning my fork into .julia/dev/
.
Is there are a more direct way to do that? Meaning, is there a way to dev
a package and convert the local clone into a fork in one's github repository?
I found this slack answer: https://stackoverflow.com/questions/33817118/github-how-to-fork-after-cloning
But that seems way too cumbersome. What do you frequent contributors to third-party packages do?
I use magit with git forge integration, I think creating the fork is as hard as typing c f giordano
or something like that, and it can automatically set the fork as default push remote
And setting fetch/push remotes appropriately is better than renaming the remotes as suggested in the stackoverflow answer, as those operations will by default use the right remote, without you having to remember to pull from/push to the right one
Magit is in emacs so I don't really recommend it to someone who isn't already invested in emacs, but it's by far the best interface to git I've ever used (although not entirely flawless)
Fwiw I've given magit to someone who doesn't use emacs and they got on fine
Magit seems like it would be worth being a standalone app, i.e. a specially configured "Emacs" that just runs magit.
Out of curiosity, do you use VSCode or keep full time in emacs?
I use only emacs
All my coding is in vscode now. The vscode port https://github.com/kahole/edamagit has a good fraction of magit's functionality so most of the time I can stay in vscode.
The easiest way I've found to do this without magic tools is the following:
Pkg.dev
-> getting a clone in .julia/dev
.git remote add gunnar FORK_URL
.git checkout -b FEATURE_BRANCH
git commit
until you're ready.git push -u gunnar HEAD
.Step 3 can be done at any time between step 2 and step 6. Other people would name the remote differently.
Gunnar Farnebäck said:
The easiest way I've found to do this without magic tools is the following:
Pkg.dev
-> getting a clone in.julia/dev
.- Go to GitHub page and create a fork.
- Change to the package directory and do
git remote add gunnar FORK_URL
.git checkout -b FEATURE_BRANCH
git commit
until you're ready.git push -u gunnar HEAD
.- Go to GitHub and click on the "create PR" button at the top of the repo.
Step 3 can be done at any time between step 2 and step 6. Other people would name the remote differently.
I prefer clonining the fork and adding upstream as a remote instead, and this way you wouldn't accidentally push into the upstream if you happen to have rights to it.
Last updated: Nov 06 2024 at 04:40 UTC