# Package versioning

**URL:** <https://discourse.julialang.org/t/package-versioning/127593>\
**Category:** New to Julia\
**Tags:** pkg\
**Created:** [April 1, 2025, 12:33pm UTC](https://discourse.julialang.org/t/package-versioning/127593 "2025-04-01T12:33:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Magnus\_Lilledahl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/magnus_lilledahl/32/51079_2.png) [@Magnus\_Lilledahl](https://discourse.julialang.org/u/Magnus_Lilledahl)\
**Post date:** [April 1, 2025, 12:33pm UTC](https://discourse.julialang.org/t/package-versioning/127593/1 "2025-04-01T12:33:28Z")

</div>

When adding packages using Pkg one can choose version using @x.y.z syntax after the package name. Is this number tied to the `version` entry in the project.toml file? Is this unrelated to any versioning in git (ie tag?).

Is it then possible to choose a specific version when loading from an unregistered repository (will Pkg somehow search all commits until it finds a project.toml with matching version) or must one then use the #commit-sha/branch syntax?

When we use the @x.y.z syntax, is this related to individual registrations in a package registry?

The vagueness of the questions reflects my confusion. Enlightenment appreciated.

(julia and git newbie)

---

<div class="post-metadata">

**Author:** ![Sevi](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@Sevi](https://discourse.julialang.org/u/Sevi)\
**Post date:** [April 1, 2025, 1:00pm UTC](https://discourse.julialang.org/t/package-versioning/127593/2 "2025-04-01T13:00:44Z")

</div>

This documentation page might be helpful:

> **[3. Managing Packages · Pkg.jl](https://pkgdocs.julialang.org/v1/managing-packages/)**
>
> Documentation for Pkg.jl.

My understanding is that

- “the version” of a package is the entry from the `Project.toml` at the time of registration in some registry, i.e. if my `Project.toml` contains `version: 0.2.1-rc1` then `pkg> add MyPackage@0.2.1-rc1` will look in the registry for the specific code that was registered under this number. If nobody ever registered a version with this number, then the package manager won’t be able to install it
- a registry can contain many versions of the same package, of course, but one version is always a unique snapshot so to say
- a package that is not registered can have a “version” (the entry in the `Project.toml`), which will also be displayed if you list the packages with `pkg> status`, but it’s just a “volatile” label for the current code; you cannot ask for a specific version of a package without a registry – this is what keeps track of all the past versions that have been registered
- git tags and branches (or commit IDs) can also be used similarly to version numbers, just with `#` instead of `@` after the package name (or URL), as described in the link above

So in short, I think the answers to your questions are “yes, yes, (no, yes), yes” 😅 Hope that helps clear up some confusion.

---

<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 1, 2025, 1:46pm UTC](https://discourse.julialang.org/t/package-versioning/127593/3 "2025-04-01T13:46:06Z")

</div>

The `@` syntax is related to registry information only. The `#` syntax is related to git commits/branches/tags only. In neither case Pkg examines `Project.toml`.

---

<div class="post-metadata">

**Author:** ![Magnus\_Lilledahl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/magnus_lilledahl/32/51079_2.png) [@Magnus\_Lilledahl](https://discourse.julialang.org/u/Magnus_Lilledahl)\
**Post date:** [April 1, 2025, 2:15pm UTC](https://discourse.julialang.org/t/package-versioning/127593/4 "2025-04-01T14:15:41Z")

</div>

I think that clears it up. Thanks for quick and good feedback.
