# Pin dependency at current state

**URL:** <https://discourse.julialang.org/t/pin-dependency-at-current-state/30128>\
**Category:** General Usage\
**Created:** [October 21, 2019, 10:52am UTC](https://discourse.julialang.org/t/pin-dependency-at-current-state/30128 "2019-10-21T10:52:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![krcools](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krcools/32/10212_2.png) [@krcools](https://discourse.julialang.org/u/krcools)\
**Post date:** [October 21, 2019, 10:52am UTC](https://discourse.julialang.org/t/pin-dependency-at-current-state/30128/1 "2019-10-21T10:52:01Z")

</div>

I want my project Project to depend on an unregistered and untagged version of a registered package ToolBox. Is this a valid way to accomplish this?

```julia
pkg>add ToolBox#master
pkg>pin ToolBox

```

When I would at a later time instantiate the environment, will the commit at master at that later time be pulled in, or will I get the commit master was pointing at when I issued the pkg commands above?

I am aware of [29480/3](https://discourse.julialang.org/t/how-to-pin-package-to-the-master-version/29480/3); this is not what I’m after.

---

<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:** [October 21, 2019, 11:29am UTC](https://discourse.julialang.org/t/pin-dependency-at-current-state/30128/2 "2019-10-21T11:29:45Z")

</div>

> [@krcools](#):
>
> When I would at a later time instantiate the environment, will the commit at master at that later time be pulled in, or will I get the commit master was pointing at when I issued the pkg commands above?

`instantiate` always gives you the exact version that is recorded in the Manifest. The effect of `pin` is that it will keep the version even if you do an explicit `update`.

---

<div class="post-metadata">

**Author:** ![krcools](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krcools/32/10212_2.png) [@krcools](https://discourse.julialang.org/u/krcools)\
**Post date:** [October 21, 2019, 12:22pm UTC](https://discourse.julialang.org/t/pin-dependency-at-current-state/30128/3 "2019-10-21T12:22:14Z")

</div>

What is recorded in Manifest.toml is

```julia
pinned = true
git-tree-sha1 = "31a045a4d0ffe4e82bf51af1f33e7761c2e7f6cb"
repo-rev = "master"

```

leading to my confusion: is master pointing at the commit at the time of pinning or is it the ever forward moving master branch?

---

<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:** [October 21, 2019, 1:03pm UTC](https://discourse.julialang.org/t/pin-dependency-at-current-state/30128/4 "2019-10-21T13:03:54Z")

</div>

It records `master` so that if you do a `update` it knows from which branch to fetch. Unless you `update` the code identified by the `git-tree-sha1` is used.
