Julia repl is ignoring my ssh config file

If i try develop --local git@github.com<>.git, the julia repl ignores my carefully crafted ssh config file and asks for my private key location. My private keys are not stored locally and are accessed through a 2fa agent - which works with everything else in my quite diverse ecosystem.

Is there anyway to get julia too look for keys via .ssh/config?

1 Like

I think there is no current way of making it honor the .config. Most people just clone the repo via the git command line program outside of the REPL and then dev the local repo inside it.

The question is not about Julia but what Julia uses to run operations, which until Julia v1.6 is libgit2. No, libgit2 doesn’t support ssh config: Support ~/.ssh/id_rsa or ~/.ssh/config · Issue #5640 · libgit2/libgit2 · GitHub. However, I believe that starting from Julia v1.7 command-line git should be used to run git operations, when available

1 Like

I believe by default Julia will still use its own libgit2, but in 1.7 you can set the environment variable JULIA_PKG_USE_CLI_GIT=true to force it to use your system git instead.

4 Likes

Simeon, would you know if there is any documentation regarding “github ssh authentication” in Julia 1.7, in particular for Windows users?

Thank you in advance.

I have no ideas for Windows in particular, but Connecting to GitHub with SSH - GitHub Docs probably has most of the information you need.

1 Like

Edited to fix typos…
Sorry to bump an old one, but maybe this will help some people. This worked for me, not sure if it’s the best solution or will work for everybody.

The environment variable is set in Julia with:

julia> ENV["JULIA_PKG_USE_CLI_GIT"]=true

If you want this behavior always (which I think many do), then you need to put this in a startup.jl file. If you don’t have one of those already, it goes here:

C:\\Users\\you\\.julia\\config\\startup.jl

and just put that one line in the file.

1 Like

I don’t think that is the correct name.

sorry, thanks for the correction!

You misspelled startup.jl

C:\\Users\\you\\.julia\\config\\startup.jl