# LocalRegistry doesn't automatically pull

**URL:** <https://discourse.julialang.org/t/localregistry-doesnt-automatically-pull/128227>\
**Category:** General Usage\
**Created:** [April 19, 2025, 5:40pm UTC](https://discourse.julialang.org/t/localregistry-doesnt-automatically-pull/128227 "2025-04-19T17:40:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![freeman](https://avatars.discourse-cdn.com/v4/letter/f/ec9cab/32.png) [@freeman](https://discourse.julialang.org/u/freeman)\
**Post date:** [April 19, 2025, 5:40pm UTC](https://discourse.julialang.org/t/localregistry-doesnt-automatically-pull/128227/1 "2025-04-19T17:40:40Z")

</div>

I’ve been using LocalRegistry to manage a personal registry in a remote git hosting website.

It allows me to do what I wanted, versioning my own packages and have Pkg do its dependency resolution job. But there’s a slight annoyance that I wanted to ask about.

My registry is called `Registry`. In my case, for whatever reason, I need to manually cd to `~/.julia/registry/Registry` and then call `git pull` after every package version that I register. I understand the reason for this - julia is looking at the local copy of the Registry repo to figure which version it knows about. However, for the default `General` registry julia decides when it needs to download it. I would rather have my own registry work the same way, because the way it is now adds the extra git pull step which I believe could be happening automatically.

Is this a matter of configuring `LocalRegistry`, or julia, or something else?

---

<div class="post-metadata">

**Author:** ![GHTaarn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ghtaarn/32/216007_2.png) [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)\
**Post date:** [April 19, 2025, 6:59pm UTC](https://discourse.julialang.org/t/localregistry-doesnt-automatically-pull/128227/2 "2025-04-19T18:59:26Z")

</div>

Have you tried just doing

```julia
using Pkg
pkg"registry up"

```

instead of the manual pull?

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [April 19, 2025, 8:11pm UTC](https://discourse.julialang.org/t/localregistry-doesnt-automatically-pull/128227/3 "2025-04-19T20:11:16Z")

</div>

Cf. [Pull-first · Issue #63 · GunnarFarneback/LocalRegistry.jl · GitHub](https://github.com/GunnarFarneback/LocalRegistry.jl/issues/63)

---

<div class="post-metadata">

**Author:** ![freeman](https://avatars.discourse-cdn.com/v4/letter/f/ec9cab/32.png) [@freeman](https://discourse.julialang.org/u/freeman)\
**Post date:** [April 20, 2025, 7:18am UTC](https://discourse.julialang.org/t/localregistry-doesnt-automatically-pull/128227/4 "2025-04-20T07:18:56Z")

</div>

> <https://github.com/GunnarFarneback/LocalRegistry.jl/issues/63#issuecomment-1382373164>
>
> Unless there's a conflict, is there any reason not to pull the remote copy of th…e registry first if the local copy is not synced with it?
> 
> Would be nice to not have to manually pull when trying to register a package on a different machine.

> Possible reasons not to pull automatically are that (…)

Hey Gunnar thanks for coming back. I’m still confused. Are you saying that even the General registry is some times not pulled automatically? Even if that’s the case and the General is some times not pulled automatically, it some times is. My own local registry on the other hand, as far as I can tell is never pulled automatically. So they behave differently, no? What is the source of this difference? Is it that Pkg knows that General is somehow special and _some times_ decides to pull, whereas it never pulls other registries automatically?

---

<div class="post-metadata">

**Author:** ![freeman](https://avatars.discourse-cdn.com/v4/letter/f/ec9cab/32.png) [@freeman](https://discourse.julialang.org/u/freeman)\
**Post date:** [April 20, 2025, 7:20am UTC](https://discourse.julialang.org/t/localregistry-doesnt-automatically-pull/128227/5 "2025-04-20T07:20:17Z")

</div>

I would call that also a manual pull. According to Gunnar’s link, the two are equivalent. I say manual in contrast to General, where I never have to do either git pull or registry up.

---

<div class="post-metadata">

**Author:** ![GHTaarn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ghtaarn/32/216007_2.png) [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)\
**Post date:** [April 20, 2025, 10:30am UTC](https://discourse.julialang.org/t/localregistry-doesnt-automatically-pull/128227/6 "2025-04-20T10:30:12Z")

</div>

I understand. The reason that I wrote that post was to illustrate that there is a simple way to do this from the Julia REPL, as in my opinion, forcing users to explicitly change things in the `.julia` directory would be bad design (except for custom configuration like `startup.jl`).

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [April 20, 2025, 1:00pm UTC](https://discourse.julialang.org/t/localregistry-doesnt-automatically-pull/128227/7 "2025-04-20T13:00:44Z")

</div>

It’s the same for General and other registries, either none is updated automatically or all registries are. What might fool you is that Pkg only does an automatic update once per session, so if you want to refresh the registry information more than once in a session, you must do an explicit update.

Illustration of both registries being updated:

```julia
$ mkdir /tmp/testdepot
$ mkdir /tmp/testregistry/
$ git -C /tmp/testregistry/ init --bare
Initialized empty Git repository in /tmp/testregistry/
$ JULIA_DEPOT_PATH=/tmp/testdepot julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.10.9 (2025-03-10)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

(@v1.10) pkg> add LocalRegistry
  Installing known registries into `/tmp/testdepot`
       Added `General` registry to /tmp/testdepot/registries
    Updating registry at `/tmp/testdepot/registries/General.toml`
   Resolving package versions...
[...]

julia> using LocalRegistry

julia> create_registry("testregistry", "file:///tmp/testregistry", push = true)
[...]
[ Info: Created registry in directory /tmp/testdepot/registries/testregistry
"/tmp/testdepot/registries/testregistry"

julia> exit()
$ JULIA_DEPOT_PATH=/tmp/testdepot julia
[...]

(@v1.10) pkg> add Example
    Updating registry at `/tmp/testdepot/registries/testregistry`
    Updating git-repo `file:///tmp/testregistry`
    Updating registry at `/tmp/testdepot/registries/General.toml`
   Resolving package versions...
   Installed Example ─ v0.5.5
    Updating `/tmp/testdepot/environments/v1.10/Project.toml`
  [7876af07] + Example v0.5.5
    Updating `/tmp/testdepot/environments/v1.10/Manifest.toml`
  [7876af07] + Example v0.5.5
Precompiling packages finished.
  1 dependency successfully precompiled in 1 seconds. 4 already precompiled.

```

---

<div class="post-metadata">

**Author:** ![freeman](https://avatars.discourse-cdn.com/v4/letter/f/ec9cab/32.png) [@freeman](https://discourse.julialang.org/u/freeman)\
**Post date:** [April 20, 2025, 8:19pm UTC](https://discourse.julialang.org/t/localregistry-doesnt-automatically-pull/128227/8 "2025-04-20T20:19:50Z")

</div>

Ok confirmed.

I’ve confirmed it by bumping some package and registering it on the Julia session that I use for registering, then on my Julia where I don’t have the package dev’ed I restarted Julia, then ran `up` (note, not `registry up`), and that brought the new version.

This is the info I was looking for, thank you.
