devtools::install_git Over SSH

こ雲淡風輕ζ 提交于 2019-12-01 03:25:45

Ran into this issue myself. I know this question is a bit old, but for anybody else running into the same issue (like me), here's what I've found.

The Problem

Likely you don't have the library that git2r (the package that devtools uses to interact with git) uses to communicate over SSH.

The Solution

Install it. The example below assumes Ubuntu.

sudo apt-get install libssh2-1 libssh2-1-dev

git2r uses a library called LibSSH2 to enable transport over SSH. You can install it using your package manager if you're on Linux. NOTE if you're on Windows, git2r does not support the SSH protocol yet :/ As of git2r version 0.11.0 (which uses an updated version of libgit2) it looks like SSH is supported on Windows as well. As of this edit, the newest version of git2r is 0.15, so if you don't have SSH support on Windows, try updating git2r (shout out to zeehio for the news).

After you've installed LibSSH2 you'll need to reinstall the git2r package to enable SSH transport (since it's enabled/disabled during the package build).

Sources

Issues on GitHub:

Why do I need LibSSH2 at all? git doesn't use it, right?

You're right! git doesn't use it (to my knowledge). However, libgit2, which is the pure C git API implementation that git2r uses, does.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!