libgit2

git_config_level_t

Version:

Priority level of a config file.

These priority levels correspond to the natural escalation logic (from higher to lower) when reading or searching for config entries in git.git. Meaning that for the same key, the configuration in the local configuration is preferred over the configuration in the system configuration file.

Callers can add their own custom configuration, beginning at the GIT_CONFIG_LEVEL_APP level.

Writes, by default, occur in the highest priority level backend that is writable. This ordering can be overridden with git_config_set_writeorder.

git_config_open_default() and git_repository_config() honor those priority levels as well.

See

Values

GIT_CONFIG_LEVEL_PROGRAMDATA
1

System-wide on Windows, for compatibility with "Portable Git".

GIT_CONFIG_LEVEL_SYSTEM
2

System-wide configuration file; /etc/gitconfig on Linux.

GIT_CONFIG_LEVEL_XDG
3

XDG compatible configuration file; typically ~/.config/git/config.

GIT_CONFIG_LEVEL_GLOBAL
4

Global configuration file is the user-specific configuration; typically ~/.gitconfig.

GIT_CONFIG_LEVEL_LOCAL
5

Local configuration, the repository-specific configuration file; typically $GIT_DIR/config.

GIT_CONFIG_LEVEL_WORKTREE
6

Worktree-specific configuration; typically $GIT_DIR/config.worktree.

GIT_CONFIG_LEVEL_APP
7

Application-specific configuration file. Callers into libgit2 can add their own configuration beginning at this level.

GIT_CONFIG_HIGHEST_LEVEL
-1

Not a configuration level; callers can use this value when querying configuration levels to specify that they want to have data from the highest-level currently configuration. This can be used to indicate that callers want the most specific config file available that actually is loaded.

Parameter To

Versions