Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install R package from Atlassian Stash

I made an R package which is hosted on my employer's instance of Atlassian Stash. I have been telling other users to clone the repo and then use devtools::install("<path-to-repo>") to install the package.

How can I have users install the package without cloning the repository? Can I do this without hosting the code somewhere more accessible?

like image 507
ClaytonJY Avatar asked Jul 07 '15 23:07

ClaytonJY


1 Answers

Using this solution as a starting point, I discovered that you can use devtools with a Stash ssh url:

devtools::install_git("ssh://[email protected]:1234/project/repo.git")

That will install from the latest commit on the master branch. You can also install a specific branch:

devtools::install_git("ssh://[email protected]:1234/project/repo.git", branch="develop")

or tag:

devtools::install_git("ssh://[email protected]:1234/project/repo.git", branch="v1.0")

(note you don't need the tags/ prefix when using a tag)

This will only work if you have SSH keys for your machine on your Stash account. Using the http clone url will not work, because you can't authenticate properly.

like image 66
ClaytonJY Avatar answered Nov 09 '22 03:11

ClaytonJY