从github购买私人回购 [英] r sourcing private repos from github

查看:140
本文介绍了从github购买私人回购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



使用 devtools


$ b

  source_url('https:// <$ p>包),使用以下命令可以很容易地获得开放式回购: raw.github.com/hadley/stringr/master/R/c.r')

但是在做与私人回购的URL相当似乎不起作用。



PS我知道我可以克隆整个回购,然后以这种方式获取文件,但是我只是在整个回购中寻找一个特定文件,并且克隆整个文件,复制代码和根据需要使用它。

解决方案

我并不是很熟悉R,但我通常会在我的项目中使用Git协议通过SSH包含私有存储库。

GitHub要求您进行身份验证才能下载私人代码。如果通过SSH使用Git,当您拉入项目依赖关系时,您的计算机将使用您的SSH密钥进行身份验证。我在使用私有宝石的Ruby项目中执行此操作,但我不确定R是否允许您使用Git通过SSH获取依赖项。


Hi I was wondering how to source private repos in github that I have been given access to.

Using the devtools package, it is easy enough to source open repos by using commands such as:

source_url('https://raw.github.com/hadley/stringr/master/R/c.r')

but doing the equivalent with the URL for a private repo doesn't seem to work.

P.S. I know I can clone the whole repo, and then get the file that way, but I'm looking for just one specific file in the whole repo to take, and it's a bit inefficient to clone the whole thing, copy the code and the use it as necessary.

解决方案

I'm not really familiar with R, but I usually include private repositories in my projects using the Git protocol over SSH.

GitHub requires you to authenticate in order to download private code. If you use Git over SSH, your machine will authenticate with your SSH key when you pull in your project dependencies. I do this with Ruby projects that make use of private gems, but I'm not sure if R lets you fetch dependencies using Git over SSH.

这篇关于从github购买私人回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆