相关疑难解决方法(0)

从RStudio到Github的回购

我喜欢github和RStudio的工作流程.最近,我创建了一个项目模板,它可以创建目录和脚本等,并希望在本地创建并推送到github.

在过去,我通过https://github.com/在RStudio中使用版本控制创建了一个项目的repo 来创建本地repo,然后转储我已经拥有的所有文件.

这似乎浪费时间.如何使用.Rproj文件获取已存在于RStudio中的目录/ repo并上传到github而不首先在https://github.com/上创建shell repo ?

我认为这可以节省工作流程的时间.

我想我可以按照方向-在 - 添加版本控制到项目下添加版本控制但这不允许我推送到github(也不应该因为RStudio如何知道你想要哪个git网站推到).

r github rstudio

18
推荐指数
1
解决办法
3092
查看次数

通过curl命令行发送到github(Windows)

我问了一个相关的问题,并意识到我没有问正确的问题(即,这不是关于git).

问题是如何在没有首先使用R在云中创建项目的情况下将项目推送到github.目前,您可以使用此问题中的信息从RStudio中的git命令行执行此操作.

现在我正在尝试从Windows机器中将其转换为R代码(Linux很简单).我通过R system调用从命令行使用curl进入第一步.我将展示我拥有的内容然后显示错误消息(感谢SimonO101让我这么做.).根据他在下面的评论,我已经进行了大量编辑以反映问题:

R代码:

repo <- "New"
user <- "trinker"
password <- "password"

url <- "http://curl.askapache.com/download/curl-7.23.1-win64-ssl-sspi.zip"
tmp <- tempfile( fileext = ".zip" )
download.file(url,tmp)
unzip(tmp, exdir = tempdir())

system(paste0(tempdir(), "/curl http://curl.haxx.se/ca/cacert.pem -o " , 
    tempdir() , "/curl-ca-bundle.crt"))

cmd1 <- paste0(tempdir(), "/curl -u '", user, ":", password, 
    "' https://api.github.com/user/repos -d '{\"name\":\"", repo, "\"}'")

system(cmd1)

cmd2 <- paste0(tempdir(), "/curl -k -u '", user, ":", password, 
    "' https://api.github.com/user/repos -d '{\"name\":\"", repo, "\"}'")

system(cmd2)
Run Code Online (Sandbox Code Playgroud)

错误消息(两种方法都相同):

> …
Run Code Online (Sandbox Code Playgroud)

windows curl r github

5
推荐指数
1
解决办法
925
查看次数

标签 统计

github ×2

r ×2

curl ×1

rstudio ×1

windows ×1