use_github {usethis} | R Documentation |
use_github()
takes a local project, creates an associated repo on GitHub,
adds it to your local repo as the origin
remote, and makes an initial push
to synchronize. use_github()
requires that your project already be a Git
repository, which you can accomplish with use_git()
, if needed. See the
Authentication section below for other necessary setup.
use_github( organisation = NULL, private = FALSE, protocol = git_protocol(), credentials = NULL, auth_token = github_token(), host = NULL )
organisation |
If supplied, the repo will be created under this
organisation, instead of the account of the user associated with the
|
private |
If |
protocol |
Optional. Should be "ssh" or "https", if specified. Defaults
to the option |
credentials |
A git2r credential object produced with
|
auth_token |
GitHub personal access token (PAT). |
host |
GitHub API host to use. Override with the endpoint-root for your GitHub enterprise instance, for example, "https://github.hostname.com/api/v3". |
A new GitHub repo will be created via the GitHub API, therefore you must
make a GitHub personal access token (PAT) available. You can either
provide this directly via the auth_token
argument or store it for retrieval
with github_token()
.
## Not run: pkgpath <- file.path(tempdir(), "testpkg") create_package(pkgpath) # creates package below temp directory proj_set(pkgpath) ## now, working inside "testpkg", initialize git repository use_git() ## create github repository and configure as git remote use_github() ## End(Not run)