Learn R Programming

archivist.github (version 0.2.6)

pushGitHubRepo: Push and Pull for Repository

Description

pushGitHubRepo adds files, commits them and pushes from Local Repository to synchronized GitHub one. pullGitHubRepo pulls (git pull) changes from remote GitHub Repository to the correspoding Local one.

This function is well explained on this http://r-bloggers.com/r-hero-saves-backup-city-with-archivist-and-github blog post.

Usage

pushGitHubRepo(repoDir = aoptions("repoDir"),
  commitMessage = aoptions("commitMessage"), repo = aoptions("repo"),
  user = aoptions("user"), password = aoptions("password"),
  files = c("gallery", "backpack.db"), ...)

pullGitHubRepo(repoDir = aoptions("repoDir"), user = aoptions("user"), password = aoptions("password"), ...)

Arguments

repoDir

A character specifing the directory to Local Repository to/from which artifacts will be pulled/pushed to GitHub.

commitMessage

A character denoting a message added to the commit while performing push. By default specified to NULL which corresponds to commit message archivist: pushGitHubRepo.

repo

A character denoting GitHub repository name and synchronized local existing directory in which an artifact will be saved.

user

A character denoting GitHub user name. Can be set globally with aoptions("user", user). See archivist-github-integration.

password

A character denoting GitHub user password. Can be set globally with aoptions("password", password). See archivist-github-integration.

files

A character vector containing directories to files that should be commited and pushed. The working directory is repoDir. By default all uncommited artifacts and backpack.db will be pushed.

...

Further arguments passed to push or pull.

Details

To learn more about Archivist Integration With GitHub visit agithub. To check the status (git status) of the Repository use git2r::status(repository(repoDir)). See examples.

References

More about archivist.github can be found on marcinkosinski.github.io/archivist.github/ and about archivist in posts' history on https://pbiecek.github.io/archivist/articles/posts.html

See Also

Other archivist.github: archive, archivist.github-package, authoriseGitHub, cloneGitHubRepo, createGitHubRepo, deleteGitHubRepo

Examples

Run this code
# NOT RUN {
authoriseGitHub(ClientID, ClientSecret) -> github_token
# authoriseGitHub also does: aoptions("github_token", github_token)
aoptions("user", user.name)
aoptions("password", user.password)

createGitHubRepo("Museum", default = TRUE) # here github_token is used
data(iris)
saveToLocalRepo(iris)
git2r::status(repository('Museum'))
pushGitHubRepo(commitMessage = "add iris")
git2r::status(repository('Museum'))

# }

Run the code above in your browser using DataLab