# Install a specific commit for unregistered package?

**URL:** https://discourse.julialang.org/t/install-a-specific-commit-for-unregistered-package/8468
**Category:** General Usage
**Created:** [January 19, 2018, 5:48am UTC](https://discourse.julialang.org/t/install-a-specific-commit-for-unregistered-package/8468 "2018-01-19T05:48:52Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![amrods](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amrods/32/2543_2.png) [@amrods](https://discourse.julialang.org/u/amrods)
#### Post date: [January 19, 2018, 5:48am UTC](https://discourse.julialang.org/t/install-a-specific-commit-for-unregistered-package/8468/1 "2018-01-19T05:48:52Z")

</div>

I’m trying to install a specific commit of a unregistered package. I tried with `Pkg.pin` but that’s only available with registered packages; and `Pkg.clone` does not have any method for that. Is it possible to install a specific commit of a repo? I’m in 0.6.2.

---

<div class="post-metadata">

### Author: ![innerlee](https://avatars.discourse-cdn.com/v4/letter/i/b19c9b/32.png) [@innerlee](https://discourse.julialang.org/u/innerlee)
#### Post date: [January 19, 2018, 6:25am UTC](https://discourse.julialang.org/t/install-a-specific-commit-for-unregistered-package/8468/2 "2018-01-19T06:25:30Z")

</div>

clone and then checkout?

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [January 19, 2018, 12:04pm UTC](https://discourse.julialang.org/t/install-a-specific-commit-for-unregistered-package/8468/3 "2018-01-19T12:04:43Z")

</div>

Easiest way is to clone, open up GitKraken, click to make a branch at that commit, and then stay there.

---

<div class="post-metadata">

### Author: ![Liso](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@Liso](https://discourse.julialang.org/u/Liso)
#### Post date: [January 21, 2018, 12:03pm UTC](https://discourse.julialang.org/t/install-a-specific-commit-for-unregistered-package/8468/4 "2018-01-21T12:03:16Z")

</div>

Do you mean something like this?

```julia
Pkg.clone("<pkg name>")
repo = LibGit2.GitRepo(joinpath(Pkg.dir(), "<pkg name>"))
LibGit2.branch!(repo, "Pin_<sha commit>", "<sha commit>")

```

New branch is necessary to avoid Pkg.update() to “unpin”… ? (I didn’t check it)

---

<div class="post-metadata">

### Author: ![nalimilan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nalimilan/32/147_2.png) [@nalimilan](https://discourse.julialang.org/u/nalimilan)
#### Post date: [January 21, 2018, 2:34pm UTC](https://discourse.julialang.org/t/install-a-specific-commit-for-unregistered-package/8468/5 "2018-01-21T14:34:55Z")

</div>

No, just call `Pkg.clone` and then `Pkg.checkout`.

---

<div class="post-metadata">

### Author: ![amrods](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amrods/32/2543_2.png) [@amrods](https://discourse.julialang.org/u/amrods)
#### Post date: [January 21, 2018, 11:32pm UTC](https://discourse.julialang.org/t/install-a-specific-commit-for-unregistered-package/8468/6 "2018-01-21T23:32:40Z")

</div>

I only have the SHA of the commit. The package doesn’t have any branches, just master and many commits. `Pkg.checkout` expects a branch.

---

<div class="post-metadata">

### Author: ![nalimilan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nalimilan/32/147_2.png) [@nalimilan](https://discourse.julialang.org/u/nalimilan)
#### Post date: [January 22, 2018, 8:47am UTC](https://discourse.julialang.org/t/install-a-specific-commit-for-unregistered-package/8468/7 "2018-01-22T08:47:52Z")

</div>

Ah, too bad. I wonder why, given that git commands generally accept either a branch or a commit.

---

<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 22, 2018, 8:54am UTC](https://discourse.julialang.org/t/install-a-specific-commit-for-unregistered-package/8468/8 "2018-01-22T08:54:16Z")

</div>

Just go to `.julia/v0.6/Package` and checkout the commit.

---

<div class="post-metadata">

### Author: ![pfarndt](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@pfarndt](https://discourse.julialang.org/u/pfarndt)
#### Post date: [April 1, 2020, 9:07am UTC](https://discourse.julialang.org/t/install-a-specific-commit-for-unregistered-package/8468/9 "2020-04-01T09:07:54Z")

</div>

[2 years later]

Julia and the Pkg system moved forward quite a bit. Is this still the way to pin an unregistered package?

Specifically, I want to use a pinned version of a package in one project and another version (say the master version) in another project.
