Unfortunately, I cannot add a private GitHub repository via Pkg.add(url=“…”), now that GitHub refuses the rsa format.
HTTPS asks for a username and password three times then fails.
I’ve seen the solution HERE, but I’m not sure how to implement export JULIA_PKG_USE_CLI_GIT=true and what to do next?
The password you need to provide is a personal access token, which you can create under the developer settings on GitHub. An alternative is to use VS Code and add the GitHub extension and sign in to it. Then it should let you add the package without authenticating.
Solution: uninstall Julia 1.7.3, reinstall and BEFORE you run Julia create the startup.jl file with ENV[“JULIA_PKG_USE_CLI_GIT”]=true. Follow Github’s SSH key guide here, then exeucte the below:
using Pkg
Pkg.add(url="...")
I replicated the issue where the SSH key wasn’t working by starting Julia before creating the startup.jl file, but I’m not sure why… regardless, hopefully that helps and thanks for the suggestions everyone.
I followed the steps, but I still cannot clone my package: ERROR: failed to clone from https://github.com/my_package.jl, error: GitError(Code:ERROR, Class:HTTP, unexpected http status code: 403)
You can deactivate most ssh settings by temporarily renaming ~/.ssh to something else (after testing you just rename it back to ~/.ssh). To me it sounds like the most likely cause of your problem is that your key does not work. Which operating system are you on?
I tried, but it seems I did not grant a “write” access. Why should I do that?
And also, how?
% git clone https://github.com/roiholtzman/Roi.jl
Cloning into 'Roi.jl'...
Username for 'https://github.com': roi.holtzman@gmail.com
Password for 'https://roi.holtzman@gmail.com@github.com':
remote: Write access to repository not granted.
fatal: unable to access 'https://github.com/roiholtzman/Roi.jl/': The requested URL returned error: 403
My guess is that you should use roiholtzman as your username rather than roi.holtzman@gmail.com. My personal access token has read only access and did not have a problem.