Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Chris-Engelhardt/8618c2aef37dfe2b7278c8936db89b0d to your computer and use it in GitHub Desktop.
Save Chris-Engelhardt/8618c2aef37dfe2b7278c8936db89b0d to your computer and use it in GitHub Desktop.
Set the stage to make a GitHub PR for Windows users
library(git2r)
library(glue)
library(usethis)
prep_for_pr <- function(username, repo_spec){
use_git_protocol("ssh")
creds <- cred_ssh_key(publickey = glue("C:/Users/{username}/.ssh/id_rsa.pub"),
privatekey = glue("C:/Users/{username}/.ssh/id_rsa"),
passphrase = character(0))
use_git_credentials(credentials = creds)
create_from_github(glue("{repo_spec}",
destdir = "C:/Users/{username}/Desktop"))
}
prep_for_pr("chrisengelhardt", "r-lib/usethis")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment