Error cloning private Github repo

I got this error when I was cloning a private Github repo. Any idea how to solve this issue? Thanks.

@Tero_Frondelius

Did you try Pkg.clone("github.com/sbohora/AreaUnderCurves.jl")?

Yes, It did not work. Thanks.

Here was similar problems, I don’t know if them were solved or not: How to bypass username/password prompt when updating private packages

Workaround is to use git directly, like you have done.

@Tero_Frondelius: Thanks. This works. The following line was the key.
git clone git@gitlab.com:GITHUB_USERNAME/PkgName.jl.git PkgName

Another quick question: The above works if the PkgName is cloned to .../v0.5/PkgName. How do I use the Symbolic link if I want to clone it to any other folder?
Thanks.

Hi @sbohor3,
If you are at the Windows operating system, I don’t know the answer. In linux:

cd .julia/v0.5
ln -s your_path_to_cloned_repo/PkgName PkgName

It looks like this may be the answer:
mklink /d path_where_you_want_symlink path_of_which_you_want_symlink

Julia has a built-in symlink command which should work on Linux, Mac, and Windows:

julia> symlink("sourcepath", "destinationpath")

Note that this will only work on Windows if your user is an administrator (if this is your personal computer, then you probably are).

4 Likes

Never knew that! That’s awesome!

@Tero_Frondelius : When I tried to clone my private repo from github, I got this error in windows. Can you help? Thanks.

image

Please post text next time, not a screenshot. It’s easier for us to read and it makes your error findable by search.

Anyway, the error you’re seeing is related to your ssh keys not being recognized by the server. But please note that the server in question is gitlab, not github, so you will need to follow gitlab’s instructions for setting up ssh access. Alternatively, you can probably avoid the issue entirely by using https instead. Just run the same git clone command but with https://gitlab.com/ instead of git@gitlab.com:

@rdeits: Thanks. I got following error when I tested my own julia package in Atom. Any help would be appreciated. Thanks.

Pkg.test("SemiparametricAUC.jl")
SemiparametricAUC.jl is not an installed package
 in #test#61(::Bool, ::Function, ::Array{AbstractString,1}) at entry.jl:749
 in (::Base.Pkg.Entry.#kw##test)(::Array{Any,1}, ::Base.Pkg.Entry.#test, ::Array{AbstractString,1}) at <missing>:0
 in (::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#test,Tuple{Array{AbstractString,1}}})() at dir.jl:31
 in cd(::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#test,Tuple{Array{AbstractString,1}}}, ::String) at file.jl:48
 in #cd#1(::Array{Any,1}, ::Function, ::Function, ::Array{AbstractString,1}, ::Vararg{Array{AbstractString,1},N}) at dir.jl:31
 in (::Base.Pkg.Dir.#kw##cd)(::Array{Any,1}, ::Base.Pkg.Dir.#cd, ::Function, ::Array{AbstractString,1}, ::Vararg{Array{AbstractString,1},N}) at <missing>:0
 in #test#3(::Bool, ::Function, ::String, ::Vararg{String,N}) at pkg.jl:258
 in test(::String, ::Vararg{String,N}) at pkg.jl:258
 in include_string(::String, ::String) at loading.jl:441
 in eval(::Module, ::Any) at boot.jl:234
 in (::Atom.##65#68)() at eval.jl:40
 in withpath(::Atom.##65#68, ::Void) at utils.jl:30
 in withpath(::Function, ::Void) at eval.jl:46
 in macro expansion at eval.jl:109 [inlined]
 in (::Atom.##64#67{Dict{String,Any}})() at task.jl:60

Pkg.test requires that your package be inside the julia package directory. It looks like you may have cloned the package in your home directory instead? You need to be in the folder that Pkg.dir() shows when you run git clone.

@rdeits: No, I have it in following location, but it still shows same error. Thanks.
~\AppData\Local\JuliaPro-0.5.1.1\pkgs-0.5.1.1\v0.5\SemiparametricAUC

Oh, sorry, my mistake! It’s actually simpler: you need:

Pkg.test("PackageName")

not

Pkg.test("PackageName.jl")

@rdeits: It worked. Thanks.

@rdeits @ChrisRackauckas @Tero_Frondelius : By the way, Pkg.add() is too slow. Is this issue fixed yet? Is there any way around it? Thanks.