libgit2

git_config_get_string

Version:

Get the value of a string config variable.

This function can only be used on snapshot config objects. The string is owned by the config and should not be freed by the user. The pointer will be valid until the config is freed.

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

Signature

int git_config_get_string(const char **out, const git_config *cfg, const char *name);

Parameters

const char **
In
out

pointer to the string

In
cfg

where to look for the variable

const char *
In
name

the variable's name

Returns

int

0 or an error code

Versions