cred_token | R Documentation |
The personal access token is stored in an envrionmental variable.
Environmental variables can be written to the file
.Renviron
. This file is read by R during startup,
see Startup
. On GitHub, personal access tokens
function like ordinary OAuth access tokens. They can be used
instead of a password for Git over HTTPS, see the “Creating
a personal access token” article on GitHub Docs.
cred_token(token = "GITHUB_PAT")
token |
The name of the environmental variable that holds the
personal access token for the authentication. Default is
|
A list of class cred_token
with entry:
The name of the environmental variable that holds the personal access token for the authentication.
Other git credential functions:
cred_env()
,
cred_ssh_key()
,
cred_user_pass()
## Not run:
## Create a personal access token credential object.
## This example assumes that the token is stored in
## the 'GITHUB_PAT' environmental variable.
repo <- repository("git2r")
cred <- cred_token()
push(repo, credentials = cred)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.