简体   繁体   中英

how do you install R packages from a private git repo with a PAT?

I am trying to install an R package from a private git repository hosted on my employer's internal Bitbucket server.

I have had success using remotes::install_git() for other projects on public servers in the past however for this specific project I need to connect to the repository via an HTTPS url and use a personal access token (PAT) to authenticate. The remotes::install_git() documentation includes an entry for adding credentials, but the documentation for this option is sparse. There is a lot of documentation for remotes::install_github(), but as this is not a github hosted repository, many of the suggestions there do not seem to work.

My go to :

gitcred <- git2r::cred_user_pass(username="$(USERNAME)",password="$(PAT)")
#here you can put any private repo such as devops azure or bitbucket, etc..
remotes::install_git("https://dev.azure.com/XXX", credentials = gitcred)'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM