download_commit: Download a commit from GitHub

Description Usage Arguments Details Value Examples

View source: R/commits.R

Description

This function downloads all the files in a commit, plus any folders, into the path specified.

Usage

1
download_commit(ref, repo, path = getwd(), ...)

Arguments

ref

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

repo

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

path

(string, optional) The path to the directory to upload. It must be readable. Default: working directory.

...

Parameters passed to gh_request().

Details

For more details see the GitHub API documentation:

Value

download_commit() returns the path where the commit is downloaded to.

Examples

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

  # Download the head of the main branch to the home directory
  download_commit(
    ref  = "main",
    repo = "ChadGoymer/githapi",
    path = "~"
  )


## End(Not run)

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