Skip to content

Passing credentials for git remotes #378

@danhalligan

Description

@danhalligan

At present, as far as I can tell, it doesn't appear to be possible to pass credentials through to git:: Remotes (e.g. git::[email protected]:dannavarro/lsr-package.git). As such, functions like remote_sha will fail (since the remote constructed with parse_one_remote does not contain any credentials). Equally, package2remote will not specify any credentials if the remote is of type git2r.

This might be an unusual use case, but in our company we need to pass credentials for internally hosted git repositories. I've created a fork that works for us. You can see the relevant diff here:
danhalligan@be9ab58

Effectively, I pass credentials from through various functions in deps.R with ... and also use git2r::cred_ssh_key() to specify default credentials when running package2remote for a git2r remote type.

I'm willing to believe that this implementation is not a general solution (since not all git dependencies will necessarily require the same credentials), but I'd be interested in a possible general solution if possible.

Related: #146 #266

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