从Atlassian Stash安装R包



我制作了一个R包,它托管在我雇主的Atlassian Stash实例上。我一直在告诉其他用户克隆repo,然后使用devtools::install("<path-to-repo>")来安装包。

如何让用户在不克隆存储库的情况下安装包?我可以做到这一点,而不托管代码的地方更容易访问?

使用此解决方案作为起点,我发现可以将devtools与Stash ssh url一起使用:

devtools::install_git("ssh://git@stash.yourdomain.com:1234/project/repo.git")

将从master分支上的最新提交安装。你也可以安装一个特定的分支:

devtools::install_git("ssh://git@stash.yourdomain.com:1234/project/repo.git", branch="develop")

或标记:

devtools::install_git("ssh://git@stash.yourdomain.com:1234/project/repo.git", branch="v1.0")

(注意使用标签时不需要tags/前缀)

这将只工作,如果你有SSH密钥为您的机器在您的Stash帐户。使用http克隆url将无法工作,因为您无法正确验证。

最新更新