createGitHubRepo: Create an Empty Repository on GitHub

Description Usage Arguments Details Note Author(s) References See Also Examples

View source: R/createGitHubRepo.R

Description

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 http://r-bloggers.com/r-hero-saves-backup-city-with-archivist-and-github blog post.

Usage

1
2
3
4
5
6
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, ...)

Arguments

repo

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

github_token

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).

user

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

repoDir

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).

password

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

repoDescription

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

readmeDescription

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

response

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

default

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

verbose

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

...

further arguments passed to createLocalRepo such as force.

Details

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.

Note

Bug reports and feature requests can be sent to https://github.com/MarcinKosinski/archivist.github/issues

Author(s)

Marcin Kosinski, m.p.kosinski@gmail.com

References

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

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
## Not run: 
# empty GitHub Repository creation
authoriseGitHub(ClientID, ClientSecret) -> github_token
# authoriseGitHub also does: aoptions("github_token", github_token)
aoptions("user", user.name)
aoptions("password", user.password)

createGitHubRepo("Museum")
createGitHubRepo("Museum-Extras", response = TRUE)
createGitHubRepo("Gallery", readmeDescription = NULL)
createGitHubRepo("Landfill", 
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
rm(przyklad)
# and load it back from md5hash_path
aread(md5hash_path)


# clone example
unlink("archive-test", recursive = TRUE)
cloneGithubRepo('https://github.com/MarcinKosinski/archive-test')
setRemoteRepo(aoptions("user"), "archive-test")
data(iris)
archive(iris)
showRemoteRepo()


## End(Not run)

MarcinKosinski/archivist.github documentation built on May 7, 2019, 2:48 p.m.