usando git y curl línea de comando

Estoy intentando escribir una función para enviar un proyecto a github sin crear primero el proyecto en las nubes. Actualmente puedes hacer esto desde la línea de comandos de git en RStudio usando información deesta pregunta.

Ahora estoy tratando de envolverlo en una función que puedo usarsystem para crear el repositorio en las nubes desde un repositorio local. Estoy trabajando en esto en una máquina con Windows y Linux (así que no estoy seguro de qué tan bien funciona esto en mac todavía). Aquí está mi código hasta ahora (detectar ubicación git):

gitpath <- NULL
    repo <- "New"
    user <- "CantPostThat"
    password <- "blargcats"


if (Sys.info()["sysname"] != "Windows") {
    gitpath <- "git"
} else {
    if (is.null(gitpath)){  
        test <- c(file.exists("C:\\Program Files (x86)\\Git\\bin\\git.exe"),
            file.exists("C:\\Program Files\\Git\\bin\\git.exe"))
        if (sum(test) == 0) {
            stop("Git not found.  Supply path to 'gitpath'")    
        }
        gitpath <- c("\"C:\\Program Files (x86)\\Git\\bin\\git\"",
            "\"C:\\Program Files\\Git\\bin\\git\"")[test][1]
    }
}

Entonces lo intento consystem:

system(paste(gitpath, "--version"))

> system(paste(gitpath, "--version"))
git version 1.7.11.msysgit.1

Se ve bien. Pero luego lo intento en un trozo de código real:

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

system(cmd1)

Y recibe el mensaje:

> system(cmd1)
git: 'curl' is not a git command. See 'git --help'.

Did you mean this?
    pull
Warning message:
running command '"C:\Program Files (x86)\Git\bin\git" curl -u ' trinker : PASSWORD ' https://api.github.com/user/repos -d '{"name":" three "}'' had status 1 

¿Cómo puedo ejecutar este comando:

curl -u 'USER:PASS' https://api.github.com/user/repos -d '{"name":"REPO"}'&nbsp;desde la consola.

También intenté correr sin poner primero git delante. Actualmente estoy en una máquina de ganar 7