Skip to contents

Git branch strings

Usage

gitCurrentBranch(repo = getwd())

gitDefaultBranch(repo = getwd(), remote = "origin")

Arguments

repo

character(1). Git repository directory path.

remote

character(1). Remote name.

Value

character(1). Git branch name.

Note

Updated 2022-05-02.

See also

  • koopa::git_default_branch (shell).

  • git branch (shell).

  • git2r package.

Examples

## > repo <- file.path("~", "git", "monorepo", "r-packages", "r-koopa")
## > gitCurrentBranch(repo)
## ## [1] "develop"
## > gitDefaultBranch(repo)
## ## [1] "main"