# Pkg3/Julia 1.0 - how to \`dev\` a specific branch of unregistered package?

**URL:** <https://discourse.julialang.org/t/pkg3-julia-1-0-how-to-dev-a-specific-branch-of-unregistered-package/15927>\
**Category:** General Usage\
**Tags:** question, package, pkg, development\
**Created:** [October 5, 2018, 1:58pm UTC](https://discourse.julialang.org/t/pkg3-julia-1-0-how-to-dev-a-specific-branch-of-unregistered-package/15927 "2018-10-05T13:58:47Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon32405968](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Post date:** [October 5, 2018, 1:58pm UTC](https://discourse.julialang.org/t/pkg3-julia-1-0-how-to-dev-a-specific-branch-of-unregistered-package/15927/1 "2018-10-05T13:58:47Z")

</div>

In the pkg mode of the Julia 1.0 REPL I can do the following to get add a specific branch of my unregistered package:

`(v1.0) pkg> add https://github.com/JuliaRheology/RHEOS.jl#v1compat`

However, if I want to dev a specific branch:

`(v1.0) pkg> dev https://github.com/JuliaRheology/RHEOS.jl#v1compat`

I get:

`ERROR: invalid token`

**Is it possible to `dev` a package with a non-master branch?**

Thanks

---

<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 5, 2018, 2:19pm UTC](https://discourse.julialang.org/t/pkg3-julia-1-0-how-to-dev-a-specific-branch-of-unregistered-package/15927/2 "2018-10-05T14:19:15Z")

</div>

You can `dev` and then just change the branch with e.g `git`.

---

<div class="post-metadata">

**Author:** ![anon32405968](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Post date:** [October 5, 2018, 2:23pm UTC](https://discourse.julialang.org/t/pkg3-julia-1-0-how-to-dev-a-specific-branch-of-unregistered-package/15927/3 "2018-10-05T14:23:02Z")

</div>

My master branch is still Julia 0.6 so I get the following error:

```julia
ERROR: Unsatisfiable requirements detected for package JLD [4138dd39]:
 JLD [4138dd39] log:
 ├─possible versions are: [0.5.0-0.5.9, 0.6.0-0.6.11, 0.8.0-0.8.3] or uninstalled
 ├─restricted to versions 0.0.0-* by RHEOS [4bf54d18], leaving only versions [0.5.0-0.5.9, 0.6.0-0.6.11, 0.8.0-0.8.3]
 │ └─RHEOS [4bf54d18] log:
 │ ├─possible versions are: 0.0.0 or uninstalled
 │ └─RHEOS [4bf54d18] is fixed to version 0.0.0
 └─restricted by julia compatibility requirements to versions: uninstalled — no versions left

```

Maybe there’s a way to ignore errors? If possible I’d like to avoid changing the master branch for now.

---

<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 5, 2018, 2:24pm UTC](https://discourse.julialang.org/t/pkg3-julia-1-0-how-to-dev-a-specific-branch-of-unregistered-package/15927/4 "2018-10-05T14:24:32Z")

</div>

Are you using 1.0.1? There’s been some fixes there that might help this.

When using `dev` the normal julia compatibility that is used in `add` should be disregarded…

---

<div class="post-metadata">

**Author:** ![anon32405968](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Post date:** [October 5, 2018, 2:26pm UTC](https://discourse.julialang.org/t/pkg3-julia-1-0-how-to-dev-a-specific-branch-of-unregistered-package/15927/5 "2018-10-05T14:26:36Z")

</div>

Yep 1.0.1, downloaded it today. Hmm that’s strange. In case it helps this is the full feedback:

```
           _

```

```julia
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.0.1 (2018-09-29)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

(v1.0) pkg> dev https://github.com/JuliaRheology/RHEOS.jl
  Updating registry at `C:\Users\louis.kaplan\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Updating git-repo `https://github.com/JuliaRheology/RHEOS.jl`
[ Info: Assigning UUID 4bf54d18-b41c-58dc-8574-a0581551535a to RHEOS
[ Info: Path `C:\Users\louis.kaplan\.julia\dev\RHEOS` exists and looks like the correct package, using existing path instead of cloning
 Resolving package versions...
ERROR: Unsatisfiable requirements detected for package JLD [4138dd39]:
 JLD [4138dd39] log:
 ├─possible versions are: [0.5.0-0.5.9, 0.6.0-0.6.11, 0.8.0-0.8.3] or uninstalled
 ├─restricted to versions 0.0.0-* by RHEOS [4bf54d18], leaving only versions [0.5.0-0.5.9, 0.6.0-0.6.11, 0.8.0-0.8.3]
 │ └─RHEOS [4bf54d18] log:
 │ ├─possible versions are: 0.0.0 or uninstalled
 │ └─RHEOS [4bf54d18] is fixed to version 0.0.0
 └─restricted by julia compatibility requirements to versions: uninstalled — no versions left

```

---

<div class="post-metadata">

**Author:** ![anon32405968](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Post date:** [October 5, 2018, 2:27pm UTC](https://discourse.julialang.org/t/pkg3-julia-1-0-how-to-dev-a-specific-branch-of-unregistered-package/15927/6 "2018-10-05T14:27:25Z")

</div>

> [@anon32405968](#):
>
> Info: Path `C:\Users\louis.kaplan\.julia\dev\RHEOS` exists and looks like the correct package, using existing path instead of cloning Resolving package versions…

I wonder if I’ve messed something up here by adding the specific branch too?

---

<div class="post-metadata">

**Author:** ![anon32405968](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Post date:** [October 5, 2018, 2:29pm UTC](https://discourse.julialang.org/t/pkg3-julia-1-0-how-to-dev-a-specific-branch-of-unregistered-package/15927/7 "2018-10-05T14:29:55Z")

</div>

Some further info, now when I navigate to `\.julia\dev\RHEOS` there is a folder there but when I type `git branch` it just shows the `master` branch.

And just in case it is helpful for diagnosis I’m on Windows 7 (64 bit) and installed Julia from .exe (not from source).

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [October 5, 2018, 3:12pm UTC](https://discourse.julialang.org/t/pkg3-julia-1-0-how-to-dev-a-specific-branch-of-unregistered-package/15927/8 "2018-10-05T15:12:05Z")

</div>

> [@anon32405968](#):
>
> Some further info, now when I navigate to `\.julia\dev\RHEOS` there is a folder there but when I type `git branch` it just shows the `master` branch.

This is the expected behavior.

---

<div class="post-metadata">

**Author:** ![anon32405968](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Post date:** [October 5, 2018, 4:00pm UTC](https://discourse.julialang.org/t/pkg3-julia-1-0-how-to-dev-a-specific-branch-of-unregistered-package/15927/9 "2018-10-05T16:00:32Z")

</div>

> [@kristoffer.carlsson](#):
>
> You can `dev` and then just change the branch with e.g `git` .

Ah I thought that all branches should be cloned in with the `dev` command and Kristoffer’s comment was saying I should be able to just checkout the branch. I understand now he meant I need to fetch it in. I did the following:

`git fetch origin v1compat:v1compat`

which seems to have worked. However it still seems counter-intuitive to yield and error yet still produce what in my case is basically the desired result?

**EDIT:** The files in the directory have updated as expected but when I try `using RHEOS` I get the following Error message:

```julia

julia> using RHEOS
ERROR: ArgumentError: Package RHEOS not found in current path:
- Run `import Pkg; Pkg.add("RHEOS")` to install the RHEOS package.

Stacktrace:
 [1] require(::Module, ::Symbol) at .\loading.jl:820

```

And although I was sure it wouldn’t work, just for full clarity I did try the REPL suggestion, which didn’t work as it is not a registered package:

```julia
julia> import Pkg

julia> Pkg.add("RHEOS")
  Updating registry at `C:\Users\louis.kaplan\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
ERROR: The following package names could not be resolved:
 * RHEOS (not found in project, manifest or registry)
Please specify by known `name=uuid`.

```

Also to note, when I `add` RHEOS (correct branch) and type `using RHEOS` it works fine (I have removed RHEOS since then to try and focus on getting the `dev` version working without any confusion).

---

<div class="post-metadata">

**Author:** ![anon32405968](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Post date:** [October 5, 2018, 4:02pm UTC](https://discourse.julialang.org/t/pkg3-julia-1-0-how-to-dev-a-specific-branch-of-unregistered-package/15927/10 "2018-10-05T16:02:20Z")

</div>

> [@kristoffer.carlsson](#):
>
> When using `dev` the normal julia compatibility that is used in `add` should be disregarded…

Thanks. Just to check, did you mean disregarded by the user or disregarded by Julia?

---

<div class="post-metadata">

**Author:** ![anon32405968](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Post date:** [October 5, 2018, 4:18pm UTC](https://discourse.julialang.org/t/pkg3-julia-1-0-how-to-dev-a-specific-branch-of-unregistered-package/15927/11 "2018-10-05T16:18:58Z")

</div>

OK, finally got it working.

I did the following

1. In Julia `pkg` mode: `dev https://github.com/JuliaRheology/RHEOS.jl`
2. Exited Julia
3. `git fetch origin v1compat:v1compat` (in the dev/RHEOS directory)
4. `git checkout v1compat`
5. In Julia `pkg` mode: `dev https://github.com/JuliaRheology/RHEOS.jl`

In the first step I get the error message described above but it still downloads the folder. In the last fifth step I do not get any error message and I can now do `using RHEOS`. To emphasise, I could not do `using RHEOS` at any point until completing all these steps.

Is this the intended behaviour? Seems a little counter-intuitive (to a fairly inexperienced Julia user). If it is I may try add a PR to the documentation to add info on this.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [October 5, 2018, 4:46pm UTC](https://discourse.julialang.org/t/pkg3-julia-1-0-how-to-dev-a-specific-branch-of-unregistered-package/15927/12 "2018-10-05T16:46:28Z")

</div>

Can you just do `resolve` at the pkg prompt instead of the final `dev`? You have to do this if dependencies change via non-pkg operations (e.g. editing a file or running a git command).

---

<div class="post-metadata">

**Author:** ![anon32405968](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Post date:** [October 5, 2018, 6:30pm UTC](https://discourse.julialang.org/t/pkg3-julia-1-0-how-to-dev-a-specific-branch-of-unregistered-package/15927/13 "2018-10-05T18:30:04Z")

</div>

> [@stevengj](#):
>
> Can you just do `resolve` at the pkg prompt instead of the final `dev` ? You have to do this if dependencies change via non-pkg operations (e.g. editing a file or running a git command).

Trying that now (so as my above post steps 1 - 4, and then `resolve` instead of step 5), then back to normal Julia REPL:

```julia
julia> using RHEOS
ERROR: ArgumentError: Package RHEOS not found in current path:
- Run `import Pkg; Pkg.add("RHEOS")` to install the RHEOS package.

Stacktrace:
 [1] require(::Module, ::Symbol) at .\loading.jl:820

```
