cred_env: Create a new environmental credential object

Description Usage Arguments Value See Also Examples

View source: R/credential.R

Description

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

Usage

1
cred_env(username = NULL, password = NULL)

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 list of class cred_env with entries:

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.

See Also

Other git credential functions: cred_ssh_key(), cred_token(), cred_user_pass()

Examples

1
2
3
4
5
6
7
8
9
## 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)

## End(Not run)

git2r documentation built on Jan. 13, 2021, 8:40 a.m.

Related to cred_env in git2r...