1
让存储库的origin
远程具有ssh url。 所以下面的代码:如何使用SSH传输连接到远程
remote = Rugged::Remote.lookup(repo, "origin")
remote.connect(:fetch)
提高Rugged::SshError: Cannot set up SSH connection without credentials
。
它看起来像rugged
支持SSH传输,因为有Rugged::Credentials::SshKey
类,并有可能为Repository.clone_at
:credentials
选项。 但我没有看到任何方式在源代码中提供Remote#connect
的凭据。我错过了什么吗?
如果有可能通过SSH连接,有没有什么办法从ssh-agent获取凭据? 似乎libgit2
可以查询ssh-agent。
我检查出了那个PR,发现'connect'方法不见了。现在如何为'ls'方法提供凭据? – TheBug