update_branch: Update a branch in a repository

Description Usage Arguments Details Value Examples

View source: R/branches.R

Description

This function updates a branch in the specified repository to point at a new commit. It must be pointed at a commit by providing a Git reference, which can be either a SHA, branch or tag. For a branch, the head commit is used.

Usage

1
update_branch(branch, ref, repo, force = FALSE, ...)

Arguments

branch

(string) The name of the branch.

ref

(string) Either a SHA, branch or tag used to identify the new commit.

repo

(string) The repository specified in the format: owner/repo.

force

(boolean, optional) Whether to force the update if it is not a simple fast-forward. Default: FALSE.

...

Parameters passed to gh_request().

Details

For more details see the GitHub API documentation:

Value

update_branch() returns a list of the branch properties.

Branch Properties:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 

  update_branch(
    name = "new-branch",
    repo = "ChadGoymer/githapi",
    ref  = "6b7b5a090d47fd3ef495620513a3f80da2487b1d"
  )


## End(Not run)

ChadGoymer/githapi documentation built on Oct. 22, 2021, 10:56 a.m.