repo_add_file uses the GitHub API to add/update files in an existing repo on GitHub. Note that due to time delays in caching, files that have been added very recently might not yet be displayed as existing and might accidentally be overwritten.

repo_add_file(
  repo,
  file,
  message = NULL,
  repo_folder = NULL,
  branch = "master",
  preserve_path = FALSE,
  overwrite = FALSE
)

Arguments

repo

Character. Address of repository in "owner/name" format.

file

Character. Local file path(s) of file or files to be added.

message

Character. Commit message. If not provided, a custom character string will be created, in the form of "Added file(s): filename(s)". If this custom message character length exceeds 50, it will be shortened to "Added file(s)".

repo_folder

Character. Name of folder on repository to save the file(s) to. If the folder does not exist on the repository, it will be created.

branch

Character. Name of branch to use, defaults to "master".

preserve_path

Logical. Should the local relative path be preserved.

overwrite

Logical. Should existing file or files with same name be overwritten, defaults to FALSE.

Examples

if (FALSE) { repo_add_file("rundel/ghclass", "./DESCRIPTION", "Update DESCRIPTION") }