Skip to content

git_clone: error authenticating: failed connecting with agent #335

Description

@pat-s

OS: Arch Linux

Using git2r in usethis::create_from_github():

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)

My ssh-agent is running and I've added the ssh key to the agent.

ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-BAHgeA39uy66/agent.6961; export SSH_AUTH_SOCK;
SSH_AGENT_PID=6962; export SSH_AGENT_PID;
echo Agent pid 6962;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions