Pkg - cloning from unregistered package, not updating

I’m trying to use an unregistered package and obtaining it from the GitHub repository by Pkg.clone(). However, it doesn’t appear to recognize that the repository has changed, and even when I delete the local copy in \.julia\dev, it restores the old repository copy from somewhere. What am I supposed to do?

Probably Pkg.dev installs old dependencies? · Issue #465 · JuliaLang/Pkg.jl · GitHub. Note that you should not use Pkg.clone anymore, use either Pkg.develop or Pkg.add, whatever suits you best in this situation.

You can just git pull manually, or clean out the stale clone in .julia/clones.

Thanks. Pkg.add and Pkg.develop doesn’t work for unregistered repositories though (“not a valid package name”).

Thanks. Pkg.add and Pkg.develop doesn’t work for unregistered repositories though (“not a valid package name”).

They do but maybe you are giving wrong input?

julia> Pkg.add("https://github.com/BioTurboNick/LocalizationMicroscopy.jl")
ERROR: https://github.com/BioTurboNick/LocalizationMicroscopy.jl is not a valid packagename

shrugs

Looking back at the documentation, using the Pkg console’s “add” command seems to work.

Did you read the docs?

1 Like

Nope. Why does the add command just work but the add function requires wrapping the URL in another object?

To avoid ambiguities about what the argument means in a possibly non-interactive environment.

1 Like

How common are such ambiguities? Seems like an extremely common usage–grabbing from a local or remote repository’s master branch–should not require unusual effort on the part of the user.

Use the REPL mode if you want convenience.

add url#branch

couldn’t be easier?

1 Like

Can I do that from within a script? If not, why not?

You can use pkg"add url#branch" if you want to. The API is going to be more stable in terms of compatibility whereas the REPL syntax may change because it is interactive.

1 Like

You can,

using Pkg
pkg" add url#branch"

but the API interface is recommended for non-interactive use.