Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
git_clone: error authenticating: failed connecting with agent #335
OS: Arch Linux
Error in git2r::clone(origin_url, normalizePath(repo_path, mustWork = FALSE), : Error in 'git2r_clone': error authenticating: failed connecting with agent
However, when specifying the credentials explicitly, everything works:
cred <- git2r::cred_ssh_key( publickey = "~/.ssh/id_rsa.pub", privatekey = "~/.ssh/id_rsa" usethis::create_from_github("<repo>", destdir = "~/git", credentials = cred)
I specifically set
Now I see:
as.list(Sys.getenv( + c("HOME", "USERPROFILE") + )) $HOME  "/home/pjs" $USERPROFILE  "/home/pjs" list.files( + Sys.getenv("USERPROFILE"), + pattern = "ssh|git", + include.dirs = TRUE, + all.files = TRUE + )  ".clusterssh" ".gitconfig" ".ssh" "git"
but it still does not work.
@jennybc I just tackled this issue again and came across a solution that worked for me on Arch.
So while you propose that
cred_ssh_key() $publickey  "/home/pjs/.ssh/id_rsa.pub" $privatekey  "/home/pjs/.ssh/id_rsa" $passphrase character(0) attr(,"class")  "cred_ssh_key"
does its job as expected. As you state in #357 we do not really know what lib2git really does in the background? So why not just rely on
Now ofc I do not know if this also helps in Windows or on any other OS but for Arch (maybe Linux in general?) it looks like a valid approach.
This aspect of git2r has been changing a lot, as a result of all this credential-finding pain, and what I said in March does not necessarily hold today. And, as you say, it varies by OS. Last I checked, my ssh keys still aren't found on Windows.
But if they will be found one day,
So for now,
Is there a point that would speak against this change?
I've just tested that on Windows and Mac. I think this will come down to whether people have a passphrase-protected SSH key. On Windows, I do not and the current behaviour of
We'll also need to think through the workflow for someone using https, i.e. make sure there is no attempt to call
After all this time, it seems that I finally managed to set up the SSH stuff the right way so the SSH keys are automatically recognized.
For Linux, specifically Arch Linux, I am now using the
Surely this more of a niche user group but maybe its worth adding it as a quick link/note somewhere in "Happy Gith with R" or elsewhere.