# EUNBORNBRANCH error when adding private package

**URL:** https://discourse.julialang.org/t/eunbornbranch-error-when-adding-private-package/28958
**Category:** General Usage
**Tags:** pkg
**Created:** [September 19, 2019, 5:27pm UTC](https://discourse.julialang.org/t/eunbornbranch-error-when-adding-private-package/28958 "2019-09-19T17:27:53Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)
#### Post date: [September 19, 2019, 5:27pm UTC](https://discourse.julialang.org/t/eunbornbranch-error-when-adding-private-package/28958/1 "2019-09-19T17:27:53Z")

</div>

We’ve been using the package manager heavily ever since 1.0, with a dedicated private git server that contains bare git repos. Everything has always worked fine, but suddenly I find myself unable to add one of our packages:

```julia
pkg> add git://git/MyProject
  Updating git-repo `git://git/MyProject`
ERROR: GitError(Code:EUNBORNBRANCH, Class:Reference, reference 'refs/heads/master' not found)
Stacktrace:
 [1] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/LibGit2/src/error.jl:101 [inlined]
 [2] head(::LibGit2.GitRepo) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/LibGit2/src/reference.jl:44
 [3] branch(::LibGit2.GitRepo) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/LibGit2/src/LibGit2.jl:368
 [4] (::getfield(Pkg.Types, Symbol("##83#86")))(::LibGit2.GitRepo) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/Types.jl:622
 [5] with(::getfield(Pkg.Types, Symbol("##83#86")), ::LibGit2.GitRepo) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/LibGit2/src/types.jl:1125
 [6] guess_rev(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/Types.jl:621
 [7] resolve_repo_add!(::Pkg.Types.Context, ::Pkg.Types.PackageSpec) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/Types.jl:691
 [8] handle_repo_add!(::Pkg.Types.Context, ::Pkg.Types.PackageSpec) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/Types.jl:706
 [9] handle_repos_add!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/Types.jl:725
 [10] #add#25(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Pkg.API.add), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/API.jl:87

```

That package has been added/updated lots of times without issue. Other packages have no such problem. Adding the package in a fresh environment causes the same issue. I can `git clone` the repo just fine. And the `refs/heads/master` file definitely exists on the git server. Does anyone have any idea? `pkg> gc` didn’t help either.

---

<div class="post-metadata">

### Author: ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)
#### Post date: [September 19, 2019, 7:34pm UTC](https://discourse.julialang.org/t/eunbornbranch-error-when-adding-private-package/28958/2 "2019-09-19T19:34:07Z")

</div>

Also: it works on a Windows machine, but not on Linux. Julia 1.2.0

---

<div class="post-metadata">

### Author: ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)
#### Post date: [September 20, 2019, 7:42pm UTC](https://discourse.julialang.org/t/eunbornbranch-error-when-adding-private-package/28958/3 "2019-09-20T19:42:00Z")

</div>

I’m assuming it works when you `git clone git://git/MyProject` from the command line?

---

<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: [September 20, 2019, 8:38pm UTC](https://discourse.julialang.org/t/eunbornbranch-error-when-adding-private-package/28958/4 "2019-09-20T20:38:07Z")

</div>

Probably something similar to [[SOLVED] Unable to use local package - #2 by kristoffer.carlsson](https://discourse.julialang.org/t/solved-unable-to-use-local-package/15946/2), i.e. the package got added when it didn’t have any commits at all and got borken. Try `rm -rf .julia/clones`.

Ideally Pkg should detect this and not cache a borken state of the repo.

---

<div class="post-metadata">

### Author: ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)
#### Post date: [September 21, 2019, 3:03pm UTC](https://discourse.julialang.org/t/eunbornbranch-error-when-adding-private-package/28958/5 "2019-09-21T15:03:51Z")

</div>

Yes, it does.

---

<div class="post-metadata">

### Author: ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)
#### Post date: [September 23, 2019, 1:44pm UTC](https://discourse.julialang.org/t/eunbornbranch-error-when-adding-private-package/28958/6 "2019-09-23T13:44:45Z")

</div>

> [@kristoffer.carlsson](#):
>
> the package got added when it didn’t have any commits at all and got borken

That’s a 1.5 year old package, that predates Julia 1.0, so I don’t think that would be the case. `rm -rf .julia/clones` fixed the issue in any case, thank you!
