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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With