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
devtools::install_git
You could try a combination of the devtools and getPass packages.
devtools
getPass
https://github.com/wrathematics/getPass
devtools::install_git( "https://gitlab.com/foo/bar.git", credentials = git2r::cred_user_pass("uname", getPass::getPass()) )
Where uname is your Gitlab user name.
uname
Gitlab