Learn R Programming

git2r (version 0.21.0)

cred_env: Create a new environmental credential object

Description

Environmental variables can be written to the file .Renviron. This file is read by R during startup, see Startup.

Usage

cred_env(username, password)

# S4 method for character,character cred_env(username, password)

Arguments

username

The name of the environmental variable that holds the username for the authentication.

password

The name of the environmental variable that holds the password for the authentication.

Value

A S4 cred_env object

See Also

Other git credential functions: cred_ssh_key, cred_token, cred_user_pass

Examples

Run this code
# NOT RUN {
## Create an environmental credential object for the username and
## password.
cred <- cred_env("NAME_OF_ENV_VARIABLE_WITH_USERNAME",
                 "NAME_OF_ENV_VARIABLE_WITH_PASSWORD")
repo <- repository("git2r")
push(repo, credentials = cred)
# }

Run the code above in your browser using DataLab