use_git
automatically. use_github_links
is called to populate the
URL
and BugReports
fields of DESCRIPTION.use_github(auth_token = github_pat(), private = FALSE, pkg = ".",
protocol = c("ssh", "https"), credentials = NULL)
GITHUB_PAT
environment variable.TRUE
, creates a private repository.as.package
for more
information.cred_ssh_key
specifying specific
ssh credentials or NULL for default ssh key and ssh-agent behaviour.
Default is NULL.auth_token
, which defaults to the value of the GITHUB_PAT
environment variable. Obtain a PAT from
The argument protocol
reflects how you wish to authenticate with
GitHub for this repo in the long run. For either protocol
, a remote
named "origin" is created, an initial push is made using the specified
protocol
, and a remote tracking branch is set. The URL of the
"origin" remote has the form git@github.com:
(protocol = "ssh"
, the default) or
https://github.com/
(protocol =
"https"
). For protocol = "ssh"
, it is assumed that public and
private keys are in the default locations, ~/.ssh/id_rsa.pub
and
~/.ssh/id_rsa
, respectively, and that ssh-agent
is configured
to manage any associated passphrase. Alternatively, specify a
cred_ssh_key
object via the credentials
parameter.
use_git_hook
,
use_github_links
, use_git
## to use default ssh protocol
create("testpkg")
use_github(pkg = "testpkg")
## or use https
create("testpkg2")
use_github(pkg = "testpkg2", protocol = "https")
Run the code above in your browser using DataLab