libgit2

git_config_find_global

Version:

Locate the path to the global configuration file

The user or global configuration file is usually located in $HOME/.gitconfig.

This method will try to guess the full path to that file, if the file exists. The returned path may be used on any git_config call to load the global configuration file.

Signature

int git_config_find_global(char *global_config_path, size_t length);

Parameters

char *
In
global_config_path

Buffer of GIT_PATH_MAX length to store the path

size_t
In
length

Returns

int

0 if a global configuration file has been found. Its path will be stored in buffer.

Versions