If you want to add a package from a url using the Pkg api (rather than the package manager repl mode as @pixel27 suggested) you need to do
That will work with a git ssh repo addresses. The Pkg.add(pkg_name::String) method only works for registered packages that you can refer to by name, i.e. Pkg.add("DataFrames").
FWIW, if you’re planning to play with a fork of a package, I would just do
Pkg.develop(url="address of your fork repo")
That will clone your fork of the package into your julia package development directory. If you then import the package (i.e. using ForkedPackage) it will load the version you’ve just cloned. If you want to go back to a registered version of the package just do Pkg.free("ForkedPackage") or run
from the package manager repl mode. Then the next time you want to switch back to your local version of the package just do
and the package manager will switch back to the version of the package sitting in your package development directory.
The julia package manager docs (your third question) is here:
The ‘#’ symbol is used more to check out a specific branch. I think this can include other people’s PR (pull request) branches, but that’s different than you creating a PR branch (which your post above seems to be about)
Some of the above I had tried and had not worked, but I will try your other suggestions first before trying to troubleshoot the ones that didn’t work.
If I do need to troubleshoot latter, I will post the error(s) I got.
*** I tried again and the error I keep getting is ‘cross-host redirect not allowed’
Pkg.add("Example") # Add a package from registry
Pkg.add("Example"; preserve=Pkg.PRESERVE_ALL) # Add the `Example` package and preserve existing dependencies
Pkg.add(name="Example", version="0.3") # Specify version; latest release in the 0.3 series
Pkg.add(name="Example", version="0.3.1") # Specify version; exact release
Pkg.add(url="https://github.com/JuliaLang/Example.jl", rev="master") # From url to remote gitrepo
Pkg.add(url="/remote/mycompany/juliapackages/OurPackage") # From path to local gitrepo
Pkg.add(url="https://github.com/Company/MonoRepo", subdir="juliapkgs/Package.jl)") # With subdir