I have a local GitLab account with an R package that can be installed by:
devtools::install_git(
url = "http://my-gitlab/my-projects/package",
credentials = git2r::cred_user_pass("user", "pass")
)
When I run renv::init() the package source is unknown. The getting started article does give details about how to setup functions to deal with private repos but I can't figure it out for GitLab when using devtools and git2r::cred_user_pass. I could store GIT_USER and GIT_PASSWORD in an .Renviron file but I'm not sure how to force the init function to user devtools::install_git with those credentials. I did try but then I get an error:
fatal: could not read Username for 'http://my-gitlab': No such device or address
All the example options they provide use a GitLab token for authentication:
# use a named list directly
options(renv.auth = list(
MyPackage = list(GITHUB_PAT = "<pat>")
))
Perhaps there is a better way to install from a local GitLab repo that will work better with renv?