Skip to content

Instantly share code, notes, and snippets.

@djnavarro
Created August 22, 2021 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djnavarro/e506aabe0315991c4c2da66c5f95608d to your computer and use it in GitHub Desktop.
Save djnavarro/e506aabe0315991c4c2da66c5f95608d to your computer and use it in GitHub Desktop.
lazy way to force git repo creation
library(gert)
library(usethis)
create_git_repo <- function(path) {
cat(path, "\n")
d <- setwd(path)
on.exit(setwd(d))
git_init()
use_git_ignore(usethis:::git_ignore_lines)
git_add(".")
git_commit_all("Initial commit")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment