createGitHubRepo {archivist.github}R Documentation

Create an Empty Repository on GitHub


createGitHubRepo is a GitHub version of createLocalRepo and creates a new GitHub repository with an empty archivist-like Repository. It also creates a Local Repository which is git-synchronized with new GitHub repository.

This function is well explained on this blog post.


createGitHubRepo(repo, github_token = aoptions("github_token"),
  user = aoptions("user"), repoDir = NULL,
  password = aoptions("password"),
  repoDescription = aoptions("repoDescription"),
  readmeDescription = aoptions("readmeDescription"),
  response = aoptions("response"), default = FALSE, verbose = FALSE, ...)



While working with a Github repository. A character denoting new GitHub repository name. White spaces will be substitued with a dash.


While working with a Github repository. An OAuth GitHub Token created with the oauth2.0_token function. See archivist-github-integration. Can be set globally with aoptions("github_token", github_token).


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


A character that specifies the directory for the Repository which is to be made. While working with GitHub Repository, this will be the directory of the synchronized Local Repository, in which the new Local Repository will be created (is NULL then is the same as repo).


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


While working with a Github repository. A character specifing the new GitHub repository description.


While working with a Github repository. A character of the content of file. By default a description of Repository. Can be set globally with aoptions("readmeDescription", readmeDescription). In order to omit file set aoptions("readmeDescription", NULL).


A logical value. Should the GitHub API response be returned.


If default = TRUE then repoDir (repo) is set as default local repository. Also the user is set as default GitHub user.


A logical value. If TRUE then additional messages will be printed out.


further arguments passed to createLocalRepo such as force.


To learn more about Archivist Integration With GitHub visit agithub.

At least one Repository must be initialized before using other functions from the archivist.github package. While working in groups, it is highly recommended to create a Repository on a shared Dropbox/GitHub folder.

All artifacts which are desired to be archived are going to be saved in the local Repository, which is an SQLite database stored in a file named backpack. After calling saveToLocalRepo function, each artifact will be archived in a md5hash.rda file. This file will be saved in a folder (under repoDir directory) named gallery. For every artifact, md5hash is a unique string of length 32 that is produced by digest function, which uses a cryptographical MD5 hash algorithm.

To learn more about artifacts visit archivist-package.

Created backpack database is a useful and fundamental tool for remembering artifact's name, class, archiving date etc. (the so called Tags) or for keeping artifact's md5hash.

Besides the backpack database, gallery folder is created in which all artifacts will be archived.

After every saveToLocalRepo call the database is refreshed. As a result, the artifact is available immediately in backpack.db database for other collaborators.


Bug reports and feature requests can be sent to


Marcin Kosinski,


More about archivist.github can be found on and about archivist in posts' history on

See Also

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


## Not run: 
# empty GitHub Repository creation
authoriseGitHub(ClientID, ClientSecret) -> github_token
# authoriseGitHub also does: aoptions("github_token", github_token)
aoptions("password", user.password)

createGitHubRepo("Museum-Extras", response = TRUE)
createGitHubRepo("Gallery", readmeDescription = NULL)
repoDescription = "My models and stuff") 
createGitHubRepo("MuseumYYYY", repoDir = "Museum_YY")
createGitHubRepo("archive-test4", default = TRUE)

## artifact's archiving
przyklad <- 1:100

# archiving
archive(przyklad) -> md5hash_path

## proof that artifact is really archived
showRemoteRepo() # uses options from setGithubRepo
# let's remove przyklad
# and load it back from md5hash_path

# clone example
unlink("archive-test", recursive = TRUE)
setRemoteRepo(aoptions("user"), "archive-test")

## End(Not run)

[Package archivist.github version 0.2.6 Index]