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')
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.
However, we recommend you install Rtools, so you can take full advantage of devtools. Soon, you will want to use devtools::install_github() to install R packages from GitHub, instead of CRAN. You will inevitably need to build a package that includes C/C++ code, which will require Rtools.
I'd highly recommend going the SSH route, and the below works for that. I found making the leap to SSH was easy, especially with R and RStudio. I'm using Windows in the below example. Edits from code I use in practice are in all caps.
creds = git2r::cred_ssh_key("C:\\Users\\MYSELF\\.ssh\\id_rsa.pub", "C:\\Users\\MYSELF\\.ssh\\id_rsa") devtools::install_git("[email protected]:GITLABGROUP/PACKAGE.git", credentials = creds)
Two quick additional comments:
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