# Cloning a repo from Github via Pluto

**URL:** <https://discourse.julialang.org/t/cloning-a-repo-from-github-via-pluto/78498>\
**Category:** New to Julia\
**Created:** [March 26, 2022, 2:39am UTC](https://discourse.julialang.org/t/cloning-a-repo-from-github-via-pluto/78498 "2022-03-26T02:39:42Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Post date:** [March 26, 2022, 2:39am UTC](https://discourse.julialang.org/t/cloning-a-repo-from-github-via-pluto/78498/1 "2022-03-26T02:39:42Z")

</div>

Hello Watchers:

I am attempting to clone a repo from  
Github within Pluto (not Julia REPL).  
Could I approach this using HTTP.jl? If  
so, could you provide an MWE? If not,  
how would you approach this?

The goal is to reproduce the  
following instructions used in  
a REPL in Pluto

```julia
$ git clone <some https: url>
$ cd <some endpoint>
$ julia --project=.

```

Thank you,

---

<div class="post-metadata">

**Author:** ![Wen-Wei\_Tseng](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wen-wei_tseng/32/28839_2.png) [@Wen-Wei\_Tseng](https://discourse.julialang.org/u/Wen-Wei_Tseng)\
**Post date:** [March 26, 2022, 3:14am UTC](https://discourse.julialang.org/t/cloning-a-repo-from-github-via-pluto/78498/2 "2022-03-26T03:14:25Z")

</div>

[Git.jl](https://github.com/JuliaVersionControl/Git.jl) might help.

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [March 26, 2022, 5:37am UTC](https://discourse.julialang.org/t/cloning-a-repo-from-github-via-pluto/78498/3 "2022-03-26T05:37:36Z")

</div>

You want to start a Julia session inside Pluto? This sounds like an X/Y problem, what are you trying to accomplish?

---

<div class="post-metadata">

**Author:** ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Post date:** [March 27, 2022, 3:26am UTC](https://discourse.julialang.org/t/cloning-a-repo-from-github-via-pluto/78498/4 "2022-03-27T03:26:46Z")

</div>

@gustaphe  
Yes – I want to execute the commands above  
in a Pluto.jl session not the REPL (command  
shell). I am attempting to access a repo for a  
package that has not yet been registered.

---

<div class="post-metadata">

**Author:** ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Post date:** [March 27, 2022, 3:28am UTC](https://discourse.julialang.org/t/cloning-a-repo-from-github-via-pluto/78498/5 "2022-03-27T03:28:27Z")

</div>

Thank you – might you know how to  
execute the following command:

```julia
julia --project=.

```

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [March 27, 2022, 5:09am UTC](https://discourse.julialang.org/t/cloning-a-repo-from-github-via-pluto/78498/6 "2022-03-27T05:09:57Z")

</div>

Yes, but you can’t run `julia` from Pluto, Pluto runs from Julia.

If you want to add an unregistered package in Pluto you have to bypass Pluto’s package manager and use

```julia
using Pkg
Pkg.add("https://url-to.unregistered.pkg/Unregistered.jl")

```

---

<div class="post-metadata">

**Author:** ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Post date:** [March 29, 2022, 8:17pm UTC](https://discourse.julialang.org/t/cloning-a-repo-from-github-via-pluto/78498/7 "2022-03-29T20:17:35Z")

</div>

Thank you for making the distinction @gustaphe.  
I was able to access the unregistered package using  
Git.jl. Might you know what the ‘julia --project=’ command  
is attempting to accomplish?

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [March 30, 2022, 4:09am UTC](https://discourse.julialang.org/t/cloning-a-repo-from-github-via-pluto/78498/8 "2022-03-30T04:09:44Z")

</div>

General advice: don’t run shell commands if you don’t know what they (are supposed to) do.

```julia
julia --project=.

```

Starts a REPL session using the current directory (`.`) as project directory. It’s equivalent to starting Julia, pressing `]` to get to the `pkg` prompt and running `activate .`.

Whatever instructions you are reading explicitly want you to do this in repl. The method I described above is how to load an unregistered package in Pluto, no `Git.jl` involved. If you need to run Julia from inside the cloned directory, for instance if it’s not a package at all but some kind of project directory, Pluto is probably not the right tool anyway. Hard to tell without knowing what you’re trying to accomplish.

---

<div class="post-metadata">

**Author:** ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Post date:** [March 30, 2022, 5:12pm UTC](https://discourse.julialang.org/t/cloning-a-repo-from-github-via-pluto/78498/9 "2022-03-30T17:12:09Z")

</div>

@gustaphe – Thank you for sharing your insight  
about this. It helps.

What I was attempting to accomplish can be found  
on a thread I started [HERE](https://discourse.julialang.org/t/python-to-julia-boolean-optimization/78062).

I wanted to execute the functions/commands within  
Pluto.jl because it less challenging to visualize and  
present. Based on the other thread, do you think using  
the REPL is a better option for this expressed purpose?

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [March 31, 2022, 5:52am UTC](https://discourse.julialang.org/t/cloning-a-repo-from-github-via-pluto/78498/10 "2022-03-31T05:52:00Z")

</div>

By now I assume that package has been registered, so `using` should work out of the box. If it doesn’t, do as I describe above. In Pluto you don’t have to bother about project directory, each Pluto notebook acts as its own.
