R/git-functions.R

Defines functions git_checkout git_current_branch

git_checkout <- function(branch) {
  stopifnot(is.character(branch) && nchar(branch) > 0)
  system(paste("git checkout", branch, "--force"))
}

git_current_branch <- function() {
  system("git rev-parse --abbrev-ref HEAD", intern=TRUE)
}
sgibb/benchgit documentation built on May 29, 2019, 8:04 p.m.