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

**URL:** <https://discourse.julialang.org/t/how-to-add-and-using-use-the-latest-commit-of-a-package-that-hasnt-been-released-yet/112947>\
**Category:** General Usage\
**Tags:** question, package, development\
**Created:** [April 15, 2024, 5:39am UTC](https://discourse.julialang.org/t/how-to-add-and-using-use-the-latest-commit-of-a-package-that-hasnt-been-released-yet/112947 "2024-04-15T05:39:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [April 15, 2024, 5:39am UTC](https://discourse.julialang.org/t/how-to-add-and-using-use-the-latest-commit-of-a-package-that-hasnt-been-released-yet/112947/1 "2024-04-15T05:39:16Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [April 15, 2024, 5:55am UTC](https://discourse.julialang.org/t/how-to-add-and-using-use-the-latest-commit-of-a-package-that-hasnt-been-released-yet/112947/2 "2024-04-15T05:55:56Z")

</div>

What about

```julia
]
add PkgA#main

```

?

Or

```julia
using Pkg
pkg"add PkgA#main"
using PkgA

```

?

---

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [April 15, 2024, 8:13am UTC](https://discourse.julialang.org/t/how-to-add-and-using-use-the-latest-commit-of-a-package-that-hasnt-been-released-yet/112947/3 "2024-04-15T08:13:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jishnub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jishnub/32/33620_2.png) [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Post date:** [April 15, 2024, 8:15am UTC](https://discourse.julialang.org/t/how-to-add-and-using-use-the-latest-commit-of-a-package-that-hasnt-been-released-yet/112947/4 "2024-04-15T08:15:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [April 15, 2024, 8:24am UTC](https://discourse.julialang.org/t/how-to-add-and-using-use-the-latest-commit-of-a-package-that-hasnt-been-released-yet/112947/5 "2024-04-15T08:24:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [April 15, 2024, 8:29am UTC](https://discourse.julialang.org/t/how-to-add-and-using-use-the-latest-commit-of-a-package-that-hasnt-been-released-yet/112947/6 "2024-04-15T08:29:26Z")

</div>

> [@jishnub](#):
>
> 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.

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. 😲

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [April 15, 2024, 9:00am UTC](https://discourse.julialang.org/t/how-to-add-and-using-use-the-latest-commit-of-a-package-that-hasnt-been-released-yet/112947/7 "2024-04-15T09:00:21Z")

</div>

No, only push Project.toml.

---

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [April 15, 2024, 9:02am UTC](https://discourse.julialang.org/t/how-to-add-and-using-use-the-latest-commit-of-a-package-that-hasnt-been-released-yet/112947/8 "2024-04-15T09:02:02Z")

</div>

Thanks! 🤝
