repo_file | R Documentation |
repo_add_file()
- Add / update files in a GitHub repository.
Note that due to delays in caching, files that have been added
very recently might not yet be displayed as existing and might accidentally
be overwritten.
repo_delete_file()
- Delete a file from a GitHub repository
repo_modify_file()
- Modify an existing file within a GitHub repository.
repo_ls()
- Low level function for listing the files in a GitHub Repository
repo_put_file()
- Low level function for adding a file to a GitHub repository
repo_get_file()
- Low level function for retrieving the content of a file from a GitHub Repository
repo_get_readme()
- Low level function for retrieving the content of the README.md
of a GitHub Repository
repo_add_file(
repo,
file,
message = NULL,
repo_folder = NULL,
branch = NULL,
preserve_path = FALSE,
overwrite = FALSE
)
repo_delete_file(repo, path, message = NULL, branch = NULL)
repo_get_file(repo, path, branch = NULL, quiet = FALSE, include_details = TRUE)
repo_get_readme(repo, branch = NULL, include_details = TRUE)
repo_ls(repo, path = ".", branch = NULL, full_path = FALSE)
repo_modify_file(
repo,
path,
pattern,
content,
method = c("replace", "before", "after"),
all = FALSE,
message = "Modified content",
branch = NULL
)
repo_put_file(
repo,
path,
content,
message = NULL,
branch = NULL,
verbose = TRUE
)
repo |
Character. Address of repository in |
file |
Character. Local file path(s) of file or files to be added. |
message |
Character. Commit message. |
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. |
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. |
path |
Character. File's path within the repository. |
quiet |
Logical. Should status messages be printed. |
include_details |
Logical. Should file details be attached as attributes.
|
full_path |
Logical. Should the function return the full path of the files and directories. |
pattern |
Character. Regex pattern. |
content |
Character or raw. Content of the file. |
method |
Character. Should the content |
all |
Character. Should all instances of the pattern be modified ( |
verbose |
Logical. Should success / failure messages be printed |
## Not run:
repo = repo_create("ghclass-test", "repo_file_test", auto_init=TRUE)
repo_ls(repo, path = ".")
repo_get_readme(repo, include_details = FALSE)
repo_get_file(repo, ".gitignore", include_details = FALSE)
repo_modify_file(
repo, path = "README.md", pattern = "repo_file_test",
content = "\n\nHello world!\n", method = "after"
)
repo_get_readme(repo, include_details = FALSE)
repo_add_file(repo, file = system.file("DESCRIPTION", package="ghclass"))
repo_get_file(repo, "DESCRIPTION", include_details = FALSE)
repo_delete_file(repo, "DESCRIPTION")
repo_delete(repo, prompt=FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.