简体   繁体   中英

Devtools install_git error

I have a doubt about “install_git” function of “devtools” package

I'm now a little bit blocked, so if you could help me..

My situation is:

  • Centos 6.5 with Apache web server and a local CRAN Mirror in /var/www/html/Rrepositories/CRAN
  • RStudio Server and R 3.2.3 in another Linux machine for developing.
  • For R developers we have thought to use “git” and “devtools” for sharing and version code. Enterprise have a local corporative Git with LDAP authentication.
  • So if they want a CRAN package, they go to mirror and if they want private repositories, they go to corporative local Git.

So I have made the next proves:

  • Git clone of hadley/stringr package (for example) and put it into /var/www/html/stringr
  • Protect this folder with user and password (with an LDAP local in my host for testing)
  • Git clone of /var/www/html/stringr from another machine of my network and all OK.
  • Access RStudio and create new project from git, so I have typed http://user@192.168.17.148/stringr/.git , it has question me the password and all OK.
  • And the test with more problems is to make an “install_git(“ http://user:password@192.168.17.148/stringr/.git ”)”. I always get this error:

Error in git2r::clone(x$url, bundle, progress = FALSE) : Error in 'git2r_clone': Invalid Content-Type: text/plain; charset=UTF-8

I think that I have misconfigured the Apache for serving git content. But I don't know why. I also want to know if with "install_git" function is possible to hide the password (some file like .wgetrc or .netrc)

Could you help me please? I would appreciate…

Thank you so much.

You need to configure Apache to use a cgi script to serve the git repository, as shown here

https://git-scm.com/book/en/v2/Git-on-the-Server-Smart-HTTP

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM