Configuration files


The configuration file for this repository.

If a the configuration hasn’t been set yet, the default config for repository will be returned, including global and system configurations (if they are available).

The Config type

static Config.get_system_config()

Return a <Config> object representing the system configuration file.

static Config.get_global_config()

Return a <Config> object representing the global configuration file.

Config.add_file(path, level=0, force=0)

Add a config file instance to an existing config.

Config.get_multivar(name, regex=None)

Get each value of a multivar ‘’name’’ as a list of strings.

The optional ‘’regex’’ parameter is expected to be a regular expression to filter the variables we’re interested in.

Config.set_multivar(name, regex, value)

Set a multivar ‘’name’’ to ‘’value’‘. ‘’regexp’’ is a regular expression to indicate which values to replace.


The Config class has an iterator which can be used to loop through all the entries in the configuration. Each element is a ConfigEntry object containing the name, level, and value of each configuration variable. Be aware that this may return multiple versions of each entry if they are set multiple times in the configuration files.

The Config Mapping interface.

When using the mapping interface, the value is returned as a string. In order to apply the git-config parsing rules, you can use Config.get_bool() or Config.get_int().


Look up key and parse its value as a boolean as per the git-config rules. Return a boolean value (True or False).

Truthy values are: ‘true’, 1, ‘on’ or ‘yes’. Falsy values are: ‘false’, 0, ‘off’ and ‘no’


Look up key and parse its value as an integer as per the git-config rules. Return an integer.

A value can have a suffix ‘k’, ‘m’ or ‘g’ which stand for ‘kilo’, ‘mega’ and ‘giga’ respectively.

The ConfigEntry type

The entry’s name


The entry’s value as a string


The entry’s git_config_level_t value