使用devtools :: install_git从Gitlab安装非公共软件包 [英] Installing non-public packages from Gitlab using devtools::install_git

查看:172
本文介绍了使用devtools :: install_git从Gitlab安装非公共软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的机构最近为我们安装了GitLab。我已经弄清楚了如何使用 devtools :: install_git 从GitLab服务器安装R软件包,并且只要项目是公开的,它就可以工作。

My institution recently installed GitLab for us. I've figured out how to install R packages from the GitLab server using devtools::install_git and it works as long as the project is public.

#* When modeltable project has Public status
devtools::install_git('https://mini-me2.lerner.ccf.org/nutterb/modeltable.git')

但是,如果我有一个列为内部的软件包或私人,如果没有某种形式的身份验证,我将无法安装该软件包。到目前为止,我还没有弄清楚如何通过URL通过身份验证。有没有人有从GitLab下载软件包的经验?

However, if I have a package that is listed as either "Internal" or "Private," I can't install the package without some form of authentication. As of yet, I haven't figured out how to pass authentication via the URL. Does anyone have experience with downloading packages from GitLab?

#* After changing the 'modeltable' project to Private status
devtools::install_git('https://mini-me2.lerner.ccf.org/nutterb/modeltable.git')
Preparing installation of modeltable using the Git-URL: https://mini-me2.lerner.ccf.org/nutterb/modeltable.git
'/usr/bin/git'clone --depth 1 --no-hardlinks https://mini-me2.lerner.ccf.org/nutterb/modeltable.git /tmp/Rtmp5aj1cU/file24493dc03a32
Error: There seems to be a problem retrieving this Git-URL.


推荐答案

您可以尝试将 devtools getPass 包。

https://github.com/wrathematics/getPass

devtools::install_git(
  "https://gitlab.com/foo/bar.git", 
  credentials = git2r::cred_user_pass("uname", getPass::getPass())
)

其中 uname 是您的 Gitlab 用户名。

这篇关于使用devtools :: install_git从Gitlab安装非公共软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆