Config file management. To display the configuration variables, call method config without the, or ... options.

config(repo = NULL, global = FALSE,,, ...)



The repository. Default is NULL.


Write option(s) to global configuration file. Default is FALSE.

The user name. Use NULL to delete the entry

The e-mail address. Use NULL to delete the entry


Additional options to write or delete from the configuration.


S3 class git_config. When writing options, the configuration is returned invisible.


There are two ways git2r can find the local repository when writing local options (1) Use the repo argument. (2) If the repo argument is NULL but the current working directory is inside the local repository, then git2r uses that repository.


if (FALSE) { ## Initialize a temporary repository path <- tempfile(pattern = "git2r-") dir.create(path) repo <- init(path) ## Set user name and email. config(repo, = "Alice", = "[email protected]") ## Display configuration config(repo) ## Delete user email. config(repo, = NULL) ## Display configuration config(repo) }