### Class

# Ggit Config

#### Description [src]

    final class Ggit.Config : Ggit.Native
    {
      /* No available fields */
    }

Represents a git configuration.

#### Ancestors

- GgitNative
- GgitObjectFactoryBase
- GObject

#### Constructors

###### ggit_config_new

Create a new config. See also `ggit_config_get_default()` to get a `GgitConfig` representing the global, XDG and system configuration files. To get a `GgitConfig` for a repository use #ggit_repository_get_config instead.

###### ggit_config_new_default

Get the global, XDG and system configuration files merged into one `GgitConfig` with their appropriate priority levels. If an error occured trying to load the various configuration files, this function will return `NULL` and `error` will be set accordingly.

###### ggit_config_new_from_file

Create a new config from a single on disk file. This is a convenience API and is exactly the same as creating an empty `GgitConfig` using

# ggit_config_new and adding the file with #ggit_config_add_file. The

level will be set to #GGIT_CONFIG_LEVEL_LOCAL. If the config could not be loaded this function returns `NULL` and `error` will be set accordingly.

#### Functions

###### ggit_config_find_global

Find the file representing the users global git configuration. This file is usually located at $HOME/.gitconfig. This function will try to guess the full path to that file, if the file exists. The returned file may then be used with #ggit_config_new_from_file or #ggit_config_add_file. This function returns `NULL` if the global config could not be found.

###### ggit_config_find_system

Find the file representing the systems global git configuration. This file is usually located at /etc/gitconfig on UNIX type systems or `PROGRAMFILES`%\Git\etc\gitconfig on windows. This function will try to guess the full path to that file, if the file exists. The returned file may then be used with #ggit_config_new_from_file or #ggit_config_add_file. This function returns `NULL` if the system config could not be found.

#### Instance methods

###### ggit_config_add_file

Add an on-disk config file instance to an existing config.

###### ggit_config_delete_entry

Delete a config variable from the config file.

###### ggit_config_foreach

Call `callback` for each configuration value.

###### ggit_config_get_bool

Get a boolean configuration value.

###### ggit_config_get_entry

Get `GgitConfigEntry` of a config variable.

###### ggit_config_get_int32

Get a int32 configuration value.

###### ggit_config_get_int64

Get a int64 configuration value.

###### ggit_config_get_string

Get the configuration value of `name` as string.

###### ggit_config_match

Matches a configuration against a regular expression. `match_info` will contain the match information if the return value is not `NULL`, otherwise `error` will be set.

###### ggit_config_match_foreach

Call `callback` for all configurations matching `regex`.

###### ggit_config_open_level

Open a specific level config derived from a multi-level one.

###### ggit_config_set_bool

Set a boolean value.

###### ggit_config_set_int32

Set a int32 value.

###### ggit_config_set_int64

Set a int64 value.

###### ggit_config_set_string

Set a new string value of a configuration.

###### ggit_config_snapshot

Create a snapshot of the current state of the configuration, which allows you to look into a consistent view of the configuration for looking up complex values (e.g. a remote, submodule).

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

##### Properties inherited from GgitNative (1)

###### Ggit.Native:native

No description available.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct GgitConfigClass {
      GgitNativeClass parent_class;

    }

No description available.

###### Class members

`parent_class: GgitNativeClass`

  No description available.