# Pkg - cloning from unregistered package, not updating

**URL:** <https://discourse.julialang.org/t/pkg-cloning-from-unregistered-package-not-updating/19720>\
**Category:** General Usage\
**Tags:** pkg\
**Created:** [January 16, 2019, 7:39pm UTC](https://discourse.julialang.org/t/pkg-cloning-from-unregistered-package-not-updating/19720 "2019-01-16T19:39:22Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![BioTurboNick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bioturbonick/32/6380_2.png) [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Post date:** [January 16, 2019, 7:39pm UTC](https://discourse.julialang.org/t/pkg-cloning-from-unregistered-package-not-updating/19720/1 "2019-01-16T19:39:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [January 16, 2019, 8:07pm UTC](https://discourse.julialang.org/t/pkg-cloning-from-unregistered-package-not-updating/19720/2 "2019-01-16T20:07:20Z")

</div>

Probably [Pkg.dev installs old dependencies? · Issue #465 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/issues/465). Note that you should not use `Pkg.clone` anymore, use either `Pkg.develop` or `Pkg.add`, whatever suits you best in this situation.

> [@BioTurboNick](#):
>
> What am I supposed to do?

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

---

<div class="post-metadata">

**Author:** ![BioTurboNick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bioturbonick/32/6380_2.png) [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Post date:** [January 16, 2019, 8:10pm UTC](https://discourse.julialang.org/t/pkg-cloning-from-unregistered-package-not-updating/19720/3 "2019-01-16T20:10:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [January 16, 2019, 8:11pm UTC](https://discourse.julialang.org/t/pkg-cloning-from-unregistered-package-not-updating/19720/4 "2019-01-16T20:11:28Z")

</div>

> 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?

---

<div class="post-metadata">

**Author:** ![BioTurboNick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bioturbonick/32/6380_2.png) [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Post date:** [January 16, 2019, 8:15pm UTC](https://discourse.julialang.org/t/pkg-cloning-from-unregistered-package-not-updating/19720/5 "2019-01-16T20:15:25Z")

</div>

```julia
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.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [January 16, 2019, 8:19pm UTC](https://discourse.julialang.org/t/pkg-cloning-from-unregistered-package-not-updating/19720/6 "2019-01-16T20:19:19Z")

</div>

Did you read the [docs](https://julialang.github.io/Pkg.jl/v1/api/)?

---

<div class="post-metadata">

**Author:** ![BioTurboNick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bioturbonick/32/6380_2.png) [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Post date:** [January 16, 2019, 8:23pm UTC](https://discourse.julialang.org/t/pkg-cloning-from-unregistered-package-not-updating/19720/7 "2019-01-16T20:23:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [January 16, 2019, 8:24pm UTC](https://discourse.julialang.org/t/pkg-cloning-from-unregistered-package-not-updating/19720/8 "2019-01-16T20:24:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![BioTurboNick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bioturbonick/32/6380_2.png) [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Post date:** [January 16, 2019, 8:30pm UTC](https://discourse.julialang.org/t/pkg-cloning-from-unregistered-package-not-updating/19720/9 "2019-01-16T20:30:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [January 16, 2019, 8:31pm UTC](https://discourse.julialang.org/t/pkg-cloning-from-unregistered-package-not-updating/19720/10 "2019-01-16T20:31:11Z")

</div>

> [@BioTurboNick](#):
>
> should not require unusual effort on the part of the user.

Use the REPL mode if you want convenience.

```julia
add url#branch

```

couldn’t be easier?

---

<div class="post-metadata">

**Author:** ![BioTurboNick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bioturbonick/32/6380_2.png) [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Post date:** [January 16, 2019, 8:33pm UTC](https://discourse.julialang.org/t/pkg-cloning-from-unregistered-package-not-updating/19720/11 "2019-01-16T20:33:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [January 16, 2019, 8:39pm UTC](https://discourse.julialang.org/t/pkg-cloning-from-unregistered-package-not-updating/19720/12 "2019-01-16T20:39:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [January 16, 2019, 8:39pm UTC](https://discourse.julialang.org/t/pkg-cloning-from-unregistered-package-not-updating/19720/13 "2019-01-16T20:39:24Z")

</div>

You can,

```julia
using Pkg
pkg" add url#branch"

```

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