git2r (version 0.10.1)

config: Config

Description

Config file management. To display the configuration variables, call method config with only the repo argument.

Usage

config(repo, user.name, user.email)

## S3 method for class 'git_repository': config(repo, user.name, user.email)

Arguments

repo
the repo to configure
user.name
the user name. Use NULL to delete the entry
user.email
the e-mail address. Use NULL to delete the entry

Value

  • S3 class git_config with the configuration

Examples

Run this code
## Initialize a temporary repository
path <- tempfile(pattern="git2r-")
dir.create(path)
repo <- init(path)

## Set user name and email. The configuration is returned
cfg <-config(repo, user.name="Alice", user.email="alice@example.org")

## View configuration list
cfg

## Display configuration
config(repo)

Run the code above in your browser using DataLab