How to `add` and `using` use the latest commit of a package that hasn't been released yet?

For example, I am developing a new package named PkgB that has a registered package PkgA as one of its dependencies. PkgA has a new commit but it hasn’t been released yet. Now I want to add and using the latest committed version of PkgA in PkgB.

I know one of the methods is to dev PkgA, but this will fetch a full clone of PkgA to ~/.julia/dev/, which is a local path. How can I keep it available If I plan to push the repository of PkgB to GitHub? Or is there any other method to deal with this issue more elegantly?

Thanks!

What about

]
add PkgA#main

?

Or

using Pkg
pkg"add PkgA#main"
using PkgA

?

1 Like

Thanks! But unfortunately, this doesn’t seem to work. :thinking:

Could you elaborate? You may need to push your Manifest.toml to GitHub if you want this to work everywhere. This usually isn’t a great idea if you’re developing a package.

1 Like

Oh, thanks! Sorry, it does work, if I restart the REPL before test.

Don’t I have to push the Manifest.toml file to GitHub when developing a package? I always thought it is necessary for a package. :astonished:

No, only push Project.toml.

1 Like

Thanks! :handshake: