从Atlassian Stash安装R包

Cla*_*nJY 4 git r devtools bitbucket-server

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

如何在克隆存储库的情况下让用户安装软件包?我可以在没有托管代码更容易访问的情况下执行此操作吗?

Cla*_*nJY 6

使用此解决方案作为起点,我发现您可以使用devtoolsStash ssh url:

devtools::install_git("ssh://git@stash.yourdomain.com:1234/project/repo.git")
Run Code Online (Sandbox Code Playgroud)

这将从master分支上的最新提交安装.您还可以安装特定分支:

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

或标记:

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

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

只有在您的Stash帐户上拥有机器的SSH密钥时,此功能才有效.使用http clone url将无法正常工作,因为您无法正确进行身份验证.