devtools :: install_git通过SSH [英] devtools::install_git Over SSH
问题描述
我编写了一个R包,保存在SSH服务器上的(裸)git存储库中,我希望能够将它安装在本地机器上,而无需手动克隆存储库。
我尝试了以下方法:
devtools :: install_git(ssh :// user_name @ remote / path / to / repository)
但是我得到错误
下载git repo ssh:// user_name @ remote / path / to / repository
git2r :: clone(x $ url,bundle,progress = FALSE):
'git2r_clone'中的错误:无法启动SSH会话:无法交换加密密钥
我在Windows 7机器上,使用R 3.1.2,git2r版本0.11.0和devtools版本1.9.1。任何帮助将不胜感激。谢谢!
自己跑进这个问题。我知道这个问题有点老,但是对于遇到同样问题的其他人(比如我),以下是我找到的。
问题
可能您没有图书馆, git2r
( devtools
用来与 git
进行交互的软件包)使用通过SSH进行通信。
解决方案
安装它。下面的例子假定Ubuntu。
sudo apt-get install libssh2-1 libssh2-1-dev
git2r
使用名为LibSSH2的库来启用SSH传输。如果你在Linux上,你可以使用你的软件包管理器来安装它。 如果你使用Windows, git2r
目前还不支持SSH协议:/ 自 git2r
版本0.11.0(使用更新版本的 libgit2
)它看起来像SSH也支持Windows 。在编辑过程中,最新版本的 git2r
为0.15,所以如果你在Windows上没有SSH支持,请尝试更新 git2r
(对zeehio大声呼喊)。
安装LibSSH2 后,您需要重新安装 git2r
包来启用SSH传输(因为它是在包构建过程中启用/禁用的)。
来源
GitHub上的问题:
- https://github.com/hadley/devtools/issues/796
- https://github.com/ropensci/git2r/issues/140
ul>
为什么我需要LibSSH2? git
不会使用它,对吗?
你是对的! git
不使用它(据我所知)。但是, libgit2 ,它是纯粹的C git
git2r
使用的API实现。
I've written an R package that I keep in a (bare) git repository on an SSH server, and I want to be able to install it on a local machine without needing to clone the repository by hand.
I've attempted the following:
devtools::install_git("ssh://user_name@remote/path/to/repository")
but I get the error
Downloading git repo ssh://user_name@remote/path/to/repository
Error in git2r::clone(x$url, bundle, progress = FALSE) :
Error in 'git2r_clone': Failed to start SSH session: Unable to exchange encryption keys
I'm on a Windows 7 machine, using R 3.1.2, git2r version 0.11.0 and devtools version 1.9.1. Any help would be greatly appreciated. Thanks!
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, As of git2r
does not support the SSH protocol yet :/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.
这篇关于devtools :: install_git通过SSH的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!