# Pkg checkout in Julia 1.0?

**URL:** <https://discourse.julialang.org/t/pkg-checkout-in-julia-1-0/13907>\
**Category:** General Usage\
**Created:** [August 22, 2018, 9:44pm UTC](https://discourse.julialang.org/t/pkg-checkout-in-julia-1-0/13907 "2018-08-22T21:44:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Post date:** [August 22, 2018, 9:44pm UTC](https://discourse.julialang.org/t/pkg-checkout-in-julia-1-0/13907/1 "2018-08-22T21:44:41Z")

</div>

how does one switch to/checkout and switch back/free from stable to the master with the new Pkg?

---

<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:** [August 22, 2018, 10:13pm UTC](https://discourse.julialang.org/t/pkg-checkout-in-julia-1-0/13907/2 "2018-08-22T22:13:11Z")

</div>

Use `pkg> add` and `pkg> free` (see their docstrings). Example:

```julia
(v1) pkg> add Example
 Resolving package versions...
  Updating `~/.julia/environments/v1.1/Project.toml`
  [7876af07] + Example v0.5.1

(v1) pkg> add Example#master
  Updating git-repo `https://github.com/JuliaLang/Example.jl.git`
 Resolving package versions...
  Updating `~/.julia/environments/v1.1/Project.toml`
  [7876af07] ↑ Example v0.5.1 ⇒ v0.5.1+ #master (https://github.com/JuliaLang/Example.jl.git)

(v1) pkg> free Example
 Resolving package versions...
  Updating `~/.julia/environments/v1.1/Project.toml`
  [7876af07] ↓ Example v0.5.1+ #master (https://github.com/JuliaLang/Example.jl.git) ⇒ v0.5.1

```

---

<div class="post-metadata">

**Author:** ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Post date:** [August 22, 2018, 10:15pm UTC](https://discourse.julialang.org/t/pkg-checkout-in-julia-1-0/13907/3 "2018-08-22T22:15:33Z")

</div>

interesting. ‘#’ is usually a comment. thanks. Is there a `Pkg.add()` version, too?

---

<div class="post-metadata">

**Author:** ![00vareladavid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/00vareladavid/32/23521_2.png) [@00vareladavid](https://discourse.julialang.org/u/00vareladavid)\
**Post date:** [August 22, 2018, 10:24pm UTC](https://discourse.julialang.org/t/pkg-checkout-in-julia-1-0/13907/4 "2018-08-22T22:24:52Z")

</div>

`Pkg` REPL mode does not use standard Julia syntax (that’s what the `Pkg` API is for).

As for versions, use e.g. `pkg> add Example@0.2.0` or equivalently `pkg> add Example@v0.2.0`.

In case you forget the syntax, run `pkg> ?add`

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [August 23, 2018, 1:02am UTC](https://discourse.julialang.org/t/pkg-checkout-in-julia-1-0/13907/5 "2018-08-23T01:02:58Z")

</div>

Also worth noting that unlike the old `checkout`, the above solutions don’t give you the full git repo and you shouldn’t be editing anything inside those packages. If it’s your intention to do any modifications, do `dev MyPackage` instead.

---

<div class="post-metadata">

**Author:** ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Post date:** [August 23, 2018, 1:11am UTC](https://discourse.julialang.org/t/pkg-checkout-in-julia-1-0/13907/6 "2018-08-23T01:11:01Z")

</div>

but is there also a `Pkg.add()` version thereof?

---

<div class="post-metadata">

**Author:** ![affans](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/affans/32/11911_2.png) [@affans](https://discourse.julialang.org/u/affans)\
**Post date:** [August 23, 2018, 3:06am UTC](https://discourse.julialang.org/t/pkg-checkout-in-julia-1-0/13907/7 "2018-08-23T03:06:31Z")

</div>

What does `free` do? For example, right now I added `add VegaLite#master` since the master branch is updated for 0.7/1.0. Eventually this will get tagged and I don’t need to track the master branch. So when that time comes i’ll have to manually run `free VegaLite` or will it be automatic? And will I need to `add` again?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [August 23, 2018, 5:31am UTC](https://discourse.julialang.org/t/pkg-checkout-in-julia-1-0/13907/8 "2018-08-23T05:31:11Z")

</div>

AFAIK you need to `free`, otherwise it will keep tracking `#master`. But you won’t need to `add` again.

---

<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:** [August 23, 2018, 6:16am UTC](https://discourse.julialang.org/t/pkg-checkout-in-julia-1-0/13907/9 "2018-08-23T06:16:02Z")

</div>

I would encourage you all to read the manual: [Pkg · The Julia Language](https://docs.julialang.org/en/v1/stdlib/Pkg/) . Every question that have been asked here have their answers in there.

> [@iwelch](#):
>
> but is there also a `Pkg.add()` version thereof?

```julia
Pkg.add(PackageSpec(name="Example", rev="master"))

```

> [@affans](#):
>
> What does `free` do?

From the docs:

> free: undoes a pin, develop, or stops tracking a repo.

---

<div class="post-metadata">

**Author:** ![ettersi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ettersi/32/6829_2.png) [@ettersi](https://discourse.julialang.org/u/ettersi)\
**Post date:** [May 1, 2019, 3:06am UTC](https://discourse.julialang.org/t/pkg-checkout-in-julia-1-0/13907/10 "2019-05-01T03:06:55Z")

</div>

Just in case anyone else is struggling with the same problem and ends up here:

The command to check out a fork of a package (e.g. pull request) seems to be

```
(v1) pkg> develop [GitHub link]

```
