4.5 GIT Configuration File

This is the format used by Git (http://git-scm.com). It is described in detail in http://www.kernel.org/pub/software/scm/git/docs/git-config.html.

The syntax is line-oriented. Comments are introduced by ‘#’ or ‘;’ character and extend up to the next physical newline. Statements are delimited by newlines.

The syntax for simple statement is:

 
ident = value

Compound statements or sections begin with a section header, i.e. a full pathname of that section using single space as a separator and enclosed in a pair of square brackets. Any identifier in the path which contains whitespace characters must be quoted using double quotes. Double quotes and backslashes appearing in a section name must be escaped as ‘\"’ and ‘\\’ correspondingly. For example:

 
[section "subsection name" subsubsection]

An alternative syntax for section headers is a full pathname of the section using single dot as a separator and enclosed in a pair of square brackets. When this syntax is used, whitespace is not allowed in section names:

 
[section.subsection.subsubsection]

A section begins with the section headers and continues until the start of next section or end of file, whichever occurs first.

Simple statements must occur only within a section. In other words, each non-empty configuration file must contain at least one section.

String values may be entirely or partially enclosed in double quotes, similarly to shell syntax. The following escape sequences are recognized within a value:

Sequence Stands for
\""
\\\
\b Backspace (ASCII 8)
\t Horizontal tab (ASCII 9)
\n Newline (ASCII 10)

A backslash immediately preceding a newline indicates line continuation. Both characters are removed and the remaining characters are joined with line that follows.