A same question has been answered at Installing from a subdirectory of Github.
However, I still cannot make it work. In my repo GitHub - ShuhuaGao/GADNF: Reconstruct Boolean network from data using GA on its DNF, there is a subfolder “src/GADNF.jl” which forms a package. I try to add it with the following:
Pkg.add(url="https://github.com/ShuhuaGao/GADNF", subdir="src/GADNF.jl")
The error is
Updating git-repo `https://github.com/ShuhuaGao/GADNF`
ERROR: expected the file `src/GADNF.jl` to exist for package `GADNF` at `C:\Users\shuhu\AppData\Local\Temp\jl_sscy2b`
Stacktrace:
[1] pkgerror(msg::String)
@ Pkg.Types C:\Users\shuhu\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Types.jl:70
[2] read_package(path::String)
@ Pkg.Types C:\Users\shuhu\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Types.jl:580
[3] resolve_projectfile!(env::Pkg.Types.EnvCache, pkg::Pkg.Types.PackageSpec, project_path::String)
@ Pkg.Types C:\Users\shuhu\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Types.jl:862
[4] (::Pkg.Types.var"#57#58"{Pkg.Types.Context, Pkg.Types.PackageSpec, String})(repo::LibGit2.GitRepo)
@ Pkg.Types C:\Users\shuhu\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Types.jl:832
[5] with(f::Pkg.Types.var"#57#58"{Pkg.Types.Context, Pkg.Types.PackageSpec, String}, obj::LibGit2.GitRepo)
@ LibGit2 C:\Users\shuhu\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\LibGit2\src\types.jl:1160
[6] handle_repo_add!(ctx::Pkg.Types.Context, pkg::Pkg.Types.PackageSpec)
@ Pkg.Types C:\Users\shuhu\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Types.jl:782
[7] handle_repos_add!(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec})
@ Pkg.Types C:\Users\shuhu\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Types.jl:852
[8] add(ctx::Pkg.Types.Context, pkgs::Vector{…}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::@Kwargs{…})
@ Pkg.API C:\Users\shuhu\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:258
[9] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{})
@ Pkg.API C:\Users\shuhu\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:159
[10] add(pkgs::Vector{Pkg.Types.PackageSpec})
@ Pkg.API C:\Users\shuhu\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:148
[11] add
@ C:\Users\shuhu\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:146 [inlined]
[12] add(; name::Nothing, uuid::Nothing, version::Nothing, url::String, rev::Nothing, path::Nothing, mode::Pkg.Types.PackageMode, subdir::String, kwargs::@Kwargs{})
@ Pkg.API C:\Users\shuhu\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:176
[13] top-level scope
@ REPL[24]:1
Some type information was truncated. Use `show(err)` to see complete types.
Any suggestion? Besides, how shall I do the same operation in REPL pkg mode, e,g, add ...
.