Skip to contents

Switches to a specified branch, optionally creating it if it doesn't exist.

Usage

git_checkout(branch_name, create = FALSE)

Arguments

branch_name

Name of the branch to checkout

create

Logical. Whether to create the branch if it doesn't exist. Default is FALSE.

Value

Invisibly returns TRUE if successful

Examples

if (FALSE) { # \dontrun{
git_checkout("main")
git_checkout("feature/new-analysis", create = TRUE)
} # }