Learn R Programming

gitlabr (version 2.0.1)

gl_list_branches: List, create and delete branches

Description

List, create and delete branches

List, create and delete branches

Usage

gl_list_branches(project, ...)

gl_get_branch(project, branch, ...)

gl_create_branch(project, branch, ref = get_main(), ...)

gl_delete_branch(project, branch, ...)

Value

Tibble of branches available in the project with descriptive variables

Arguments

project

name or id of project (not repository!)

...

passed on to gitlab()

branch

name of branch to create / delete / get information

ref

ref name of origin for newly created branch

Examples

Run this code
if (FALSE) {
set_gitlab_connection(gitlab_url = "https://gitlab.com",
  private_token = Sys.getenv("GITLAB_COM_TOKEN"))
project_id <- ... ## Fill in your project ID

# List branches of the project
gl_list_branches(project_ = "<>") 
# Create branch "new_feature"
gl_create_branch(project = "<>",
                 branch = "new_feature")
# Confirm that the branch was created
gl_get_branch("<>", branch = "new_feature")
# List all branches - this may take some time before your branch really appears there
gl_list_branches(project = "<>")
# Delete branch again
gl_delete_branch(project = "<>",
                 branch = "new_feature")
# Check that we're back where we started
gl_list_branches(project = "<>")
}

Run the code above in your browser using DataLab