2006-04-25 00:59:33 +02:00
|
|
|
CONFIGURATION FILE
|
|
|
|
------------------
|
|
|
|
|
2013-01-21 20:17:53 +01:00
|
|
|
The Git configuration file contains a number of variables that affect
|
2018-10-21 16:02:28 +02:00
|
|
|
the Git commands' behavior. The files `.git/config` and optionally
|
|
|
|
`config.worktree` (see `extensions.worktreeConfig` below) in each
|
|
|
|
repository are used to store the configuration for that repository, and
|
2009-04-23 11:38:02 +02:00
|
|
|
`$HOME/.gitconfig` is used to store a per-user configuration as
|
2009-04-23 11:38:00 +02:00
|
|
|
fallback values for the `.git/config` file. The file `/etc/gitconfig`
|
2009-04-23 11:38:02 +02:00
|
|
|
can be used to store a system-wide default configuration.
|
2007-01-17 07:45:35 +01:00
|
|
|
|
2013-01-21 20:17:53 +01:00
|
|
|
The configuration variables are used by both the Git plumbing
|
2009-04-23 11:38:01 +02:00
|
|
|
and the porcelains. The variables are divided into sections, wherein
|
|
|
|
the fully qualified variable name of the variable itself is the last
|
2006-04-25 00:59:33 +02:00
|
|
|
dot-separated segment and the section name is everything before the last
|
2012-03-01 11:59:45 +01:00
|
|
|
dot. The variable names are case-insensitive, allow only alphanumeric
|
|
|
|
characters and `-`, and must start with an alphabetic character. Some
|
2015-03-04 19:26:17 +01:00
|
|
|
variables may appear multiple times; we say then that the variable is
|
|
|
|
multivalued.
|
2006-04-25 00:59:33 +02:00
|
|
|
|
2007-01-22 16:25:47 +01:00
|
|
|
Syntax
|
|
|
|
~~~~~~
|
|
|
|
|
2006-04-25 00:59:33 +02:00
|
|
|
The syntax is fairly flexible and permissive; whitespaces are mostly
|
2007-01-22 16:25:47 +01:00
|
|
|
ignored. The '#' and ';' characters begin comments to the end of line,
|
|
|
|
blank lines are ignored.
|
|
|
|
|
|
|
|
The file consists of sections and variables. A section begins with
|
|
|
|
the name of the section in square brackets and continues until the next
|
2015-03-04 05:03:50 +01:00
|
|
|
section begins. Section names are case-insensitive. Only alphanumeric
|
2009-03-15 12:30:52 +01:00
|
|
|
characters, `-` and `.` are allowed in section names. Each variable
|
2009-04-23 11:38:00 +02:00
|
|
|
must belong to some section, which means that there must be a section
|
|
|
|
header before the first setting of a variable.
|
2007-01-22 16:25:47 +01:00
|
|
|
|
|
|
|
Sections can be further divided into subsections. To begin a subsection
|
|
|
|
put its name in double quotes, separated by space from the section name,
|
2009-04-23 11:38:00 +02:00
|
|
|
in the section header, like in the example below:
|
2007-01-22 16:25:47 +01:00
|
|
|
|
|
|
|
--------
|
|
|
|
[section "subsection"]
|
|
|
|
|
|
|
|
--------
|
|
|
|
|
2009-04-23 11:38:01 +02:00
|
|
|
Subsection names are case sensitive and can contain any characters except
|
2017-12-21 14:10:42 +01:00
|
|
|
newline and the null byte. Doublequote `"` and backslash can be included
|
|
|
|
by escaping them as `\"` and `\\`, respectively. Backslashes preceding
|
|
|
|
other characters are dropped when reading; for example, `\t` is read as
|
|
|
|
`t` and `\0` is read as `0` Section headers cannot span multiple lines.
|
|
|
|
Variables may belong directly to a section or to a given subsection. You
|
|
|
|
can have `[section]` if you have `[section "subsection"]`, but you don't
|
|
|
|
need to.
|
2007-01-22 16:25:47 +01:00
|
|
|
|
2011-10-12 17:52:06 +02:00
|
|
|
There is also a deprecated `[section.subsection]` syntax. With this
|
|
|
|
syntax, the subsection name is converted to lower-case and is also
|
|
|
|
compared case sensitively. These subsection names follow the same
|
|
|
|
restrictions as section names.
|
2007-01-22 16:25:47 +01:00
|
|
|
|
2009-07-25 02:28:50 +02:00
|
|
|
All the other lines (and the remainder of the line after the section
|
|
|
|
header) are recognized as setting variables, in the form
|
2015-03-04 20:08:34 +01:00
|
|
|
'name = value' (or just 'name', which is a short-hand to say that
|
|
|
|
the variable is the boolean "true").
|
2012-03-01 11:59:45 +01:00
|
|
|
The variable names are case-insensitive, allow only alphanumeric characters
|
2015-03-04 19:26:17 +01:00
|
|
|
and `-`, and must start with an alphabetic character.
|
2007-01-22 16:25:47 +01:00
|
|
|
|
2015-03-04 19:33:38 +01:00
|
|
|
A line that defines a value can be continued to the next line by
|
|
|
|
ending it with a `\`; the backquote and the end-of-line are
|
|
|
|
stripped. Leading whitespaces after 'name =', the remainder of the
|
|
|
|
line after the first comment character '#' or ';', and trailing
|
|
|
|
whitespaces of the line are discarded unless they are enclosed in
|
|
|
|
double quotes. Internal whitespaces within the value are retained
|
|
|
|
verbatim.
|
2007-01-22 16:25:47 +01:00
|
|
|
|
2015-03-04 19:33:38 +01:00
|
|
|
Inside double quotes, double quote `"` and backslash `\` characters
|
|
|
|
must be escaped: use `\"` for `"` and `\\` for `\`.
|
2007-01-22 16:25:47 +01:00
|
|
|
|
2009-03-15 12:30:52 +01:00
|
|
|
The following escape sequences (beside `\"` and `\\`) are recognized:
|
|
|
|
`\n` for newline character (NL), `\t` for horizontal tabulation (HT, TAB)
|
2014-04-01 00:11:44 +02:00
|
|
|
and `\b` for backspace (BS). Other char escape sequences (including octal
|
|
|
|
escape sequences) are invalid.
|
2007-01-22 16:25:47 +01:00
|
|
|
|
2006-04-25 00:59:33 +02:00
|
|
|
|
config: add include directive
It can be useful to split your ~/.gitconfig across multiple
files. For example, you might have a "main" file which is
used on many machines, but a small set of per-machine
tweaks. Or you may want to make some of your config public
(e.g., clever aliases) while keeping other data back (e.g.,
your name or other identifying information). Or you may want
to include a number of config options in some subset of your
repos without copying and pasting (e.g., you want to
reference them from the .git/config of participating repos).
This patch introduces an include directive for config files.
It looks like:
[include]
path = /path/to/file
This is syntactically backwards-compatible with existing git
config parsers (i.e., they will see it as another config
entry and ignore it unless you are looking up include.path).
The implementation provides a "git_config_include" callback
which wraps regular config callbacks. Callers can pass it to
git_config_from_file, and it will transparently follow any
include directives, passing all of the discovered options to
the real callback.
Include directives are turned on automatically for "regular"
git config parsing. This includes calls to git_config, as
well as calls to the "git config" program that do not
specify a single file (e.g., using "-f", "--global", etc).
They are not turned on in other cases, including:
1. Parsing of other config-like files, like .gitmodules.
There isn't a real need, and I'd rather be conservative
and avoid unnecessary incompatibility or confusion.
2. Reading single files via "git config". This is for two
reasons:
a. backwards compatibility with scripts looking at
config-like files.
b. inspection of a specific file probably means you
care about just what's in that file, not a general
lookup for "do we have this value anywhere at
all". If that is not the case, the caller can
always specify "--includes".
3. Writing files via "git config"; we want to treat
include.* variables as literal items to be copied (or
modified), and not expand them. So "git config
--unset-all foo.bar" would operate _only_ on
.git/config, not any of its included files (just as it
also does not operate on ~/.gitconfig).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-06 10:54:04 +01:00
|
|
|
Includes
|
|
|
|
~~~~~~~~
|
|
|
|
|
2017-05-11 11:10:47 +02:00
|
|
|
The `include` and `includeIf` sections allow you to include config
|
|
|
|
directives from another source. These sections behave identically to
|
|
|
|
each other with the exception that `includeIf` sections may be ignored
|
|
|
|
if their condition does not evaluate to true; see "Conditional includes"
|
|
|
|
below.
|
|
|
|
|
2017-03-01 12:26:29 +01:00
|
|
|
You can include a config file from another by setting the special
|
2017-05-11 11:10:47 +02:00
|
|
|
`include.path` (or `includeIf.*.path`) variable to the name of the file
|
|
|
|
to be included. The variable takes a pathname as its value, and is
|
|
|
|
subject to tilde expansion. These variables can be given multiple times.
|
2016-04-29 19:43:55 +02:00
|
|
|
|
2017-05-11 11:13:04 +02:00
|
|
|
The contents of the included file are inserted immediately, as if they
|
|
|
|
had been found at the location of the include directive. If the value of the
|
2017-05-11 11:10:47 +02:00
|
|
|
variable is a relative path, the path is considered to
|
2017-03-01 12:26:30 +01:00
|
|
|
be relative to the configuration file in which the include directive
|
|
|
|
was found. See below for examples.
|
2016-04-29 19:43:55 +02:00
|
|
|
|
config: add conditional include
Sometimes a set of repositories want to share configuration settings
among themselves that are distinct from other such sets of repositories.
A user may work on two projects, each of which have multiple
repositories, and use one user.email for one project while using another
for the other.
Setting $GIT_DIR/.config works, but if the penalty of forgetting to
update $GIT_DIR/.config is high (especially when you end up cloning
often), it may not be the best way to go. Having the settings in
~/.gitconfig, which would work for just one set of repositories, would
not well in such a situation. Having separate ${HOME}s may add more
problems than it solves.
Extend the include.path mechanism that lets a config file include
another config file, so that the inclusion can be done only when some
conditions hold. Then ~/.gitconfig can say "include config-project-A
only when working on project-A" for each project A the user works on.
In this patch, the only supported grouping is based on $GIT_DIR (in
absolute path), so you would need to group repositories by directory, or
something like that to take advantage of it.
We already have include.path for unconditional includes. This patch goes
with includeIf.<condition>.path to make it clearer that a condition is
required. The new config has the same backward compatibility approach as
include.path: older git versions that don't understand includeIf will
simply ignore them.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01 12:26:31 +01:00
|
|
|
Conditional includes
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
You can include a config file from another conditionally by setting a
|
|
|
|
`includeIf.<condition>.path` variable to the name of the file to be
|
2017-05-11 11:10:47 +02:00
|
|
|
included.
|
config: add conditional include
Sometimes a set of repositories want to share configuration settings
among themselves that are distinct from other such sets of repositories.
A user may work on two projects, each of which have multiple
repositories, and use one user.email for one project while using another
for the other.
Setting $GIT_DIR/.config works, but if the penalty of forgetting to
update $GIT_DIR/.config is high (especially when you end up cloning
often), it may not be the best way to go. Having the settings in
~/.gitconfig, which would work for just one set of repositories, would
not well in such a situation. Having separate ${HOME}s may add more
problems than it solves.
Extend the include.path mechanism that lets a config file include
another config file, so that the inclusion can be done only when some
conditions hold. Then ~/.gitconfig can say "include config-project-A
only when working on project-A" for each project A the user works on.
In this patch, the only supported grouping is based on $GIT_DIR (in
absolute path), so you would need to group repositories by directory, or
something like that to take advantage of it.
We already have include.path for unconditional includes. This patch goes
with includeIf.<condition>.path to make it clearer that a condition is
required. The new config has the same backward compatibility approach as
include.path: older git versions that don't understand includeIf will
simply ignore them.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01 12:26:31 +01:00
|
|
|
|
|
|
|
The condition starts with a keyword followed by a colon and some data
|
|
|
|
whose format and meaning depends on the keyword. Supported keywords
|
|
|
|
are:
|
|
|
|
|
|
|
|
`gitdir`::
|
|
|
|
|
|
|
|
The data that follows the keyword `gitdir:` is used as a glob
|
|
|
|
pattern. If the location of the .git directory matches the
|
|
|
|
pattern, the include condition is met.
|
|
|
|
+
|
|
|
|
The .git location may be auto-discovered, or come from `$GIT_DIR`
|
|
|
|
environment variable. If the repository is auto discovered via a .git
|
|
|
|
file (e.g. from submodules, or a linked worktree), the .git location
|
|
|
|
would be the final location where the .git directory is, not where the
|
|
|
|
.git file is.
|
|
|
|
+
|
|
|
|
The pattern can contain standard globbing wildcards and two additional
|
|
|
|
ones, `**/` and `/**`, that can match multiple path components. Please
|
|
|
|
refer to linkgit:gitignore[5] for details. For convenience:
|
|
|
|
|
|
|
|
* If the pattern starts with `~/`, `~` will be substituted with the
|
|
|
|
content of the environment variable `HOME`.
|
|
|
|
|
|
|
|
* If the pattern starts with `./`, it is replaced with the directory
|
|
|
|
containing the current config file.
|
|
|
|
|
|
|
|
* If the pattern does not start with either `~/`, `./` or `/`, `**/`
|
|
|
|
will be automatically prepended. For example, the pattern `foo/bar`
|
|
|
|
becomes `**/foo/bar` and would match `/any/path/to/foo/bar`.
|
|
|
|
|
|
|
|
* If the pattern ends with `/`, `**` will be automatically added. For
|
|
|
|
example, the pattern `foo/` becomes `foo/**`. In other words, it
|
|
|
|
matches "foo" and everything inside, recursively.
|
|
|
|
|
|
|
|
`gitdir/i`::
|
|
|
|
This is the same as `gitdir` except that matching is done
|
|
|
|
case-insensitively (e.g. on case-insensitive file sytems)
|
|
|
|
|
|
|
|
A few more notes on matching via `gitdir` and `gitdir/i`:
|
|
|
|
|
|
|
|
* Symlinks in `$GIT_DIR` are not resolved before matching.
|
|
|
|
|
2017-05-16 10:28:46 +02:00
|
|
|
* Both the symlink & realpath versions of paths will be matched
|
|
|
|
outside of `$GIT_DIR`. E.g. if ~/git is a symlink to
|
|
|
|
/mnt/storage/git, both `gitdir:~/git` and `gitdir:/mnt/storage/git`
|
|
|
|
will match.
|
|
|
|
+
|
|
|
|
This was not the case in the initial release of this feature in
|
|
|
|
v2.13.0, which only matched the realpath version. Configuration that
|
|
|
|
wants to be compatible with the initial release of this feature needs
|
|
|
|
to either specify only the realpath version, or both versions.
|
|
|
|
|
config: add conditional include
Sometimes a set of repositories want to share configuration settings
among themselves that are distinct from other such sets of repositories.
A user may work on two projects, each of which have multiple
repositories, and use one user.email for one project while using another
for the other.
Setting $GIT_DIR/.config works, but if the penalty of forgetting to
update $GIT_DIR/.config is high (especially when you end up cloning
often), it may not be the best way to go. Having the settings in
~/.gitconfig, which would work for just one set of repositories, would
not well in such a situation. Having separate ${HOME}s may add more
problems than it solves.
Extend the include.path mechanism that lets a config file include
another config file, so that the inclusion can be done only when some
conditions hold. Then ~/.gitconfig can say "include config-project-A
only when working on project-A" for each project A the user works on.
In this patch, the only supported grouping is based on $GIT_DIR (in
absolute path), so you would need to group repositories by directory, or
something like that to take advantage of it.
We already have include.path for unconditional includes. This patch goes
with includeIf.<condition>.path to make it clearer that a condition is
required. The new config has the same backward compatibility approach as
include.path: older git versions that don't understand includeIf will
simply ignore them.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01 12:26:31 +01:00
|
|
|
* Note that "../" is not special and will match literally, which is
|
|
|
|
unlikely what you want.
|
config: add include directive
It can be useful to split your ~/.gitconfig across multiple
files. For example, you might have a "main" file which is
used on many machines, but a small set of per-machine
tweaks. Or you may want to make some of your config public
(e.g., clever aliases) while keeping other data back (e.g.,
your name or other identifying information). Or you may want
to include a number of config options in some subset of your
repos without copying and pasting (e.g., you want to
reference them from the .git/config of participating repos).
This patch introduces an include directive for config files.
It looks like:
[include]
path = /path/to/file
This is syntactically backwards-compatible with existing git
config parsers (i.e., they will see it as another config
entry and ignore it unless you are looking up include.path).
The implementation provides a "git_config_include" callback
which wraps regular config callbacks. Callers can pass it to
git_config_from_file, and it will transparently follow any
include directives, passing all of the discovered options to
the real callback.
Include directives are turned on automatically for "regular"
git config parsing. This includes calls to git_config, as
well as calls to the "git config" program that do not
specify a single file (e.g., using "-f", "--global", etc).
They are not turned on in other cases, including:
1. Parsing of other config-like files, like .gitmodules.
There isn't a real need, and I'd rather be conservative
and avoid unnecessary incompatibility or confusion.
2. Reading single files via "git config". This is for two
reasons:
a. backwards compatibility with scripts looking at
config-like files.
b. inspection of a specific file probably means you
care about just what's in that file, not a general
lookup for "do we have this value anywhere at
all". If that is not the case, the caller can
always specify "--includes".
3. Writing files via "git config"; we want to treat
include.* variables as literal items to be copied (or
modified), and not expand them. So "git config
--unset-all foo.bar" would operate _only_ on
.git/config, not any of its included files (just as it
also does not operate on ~/.gitconfig).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-06 10:54:04 +01:00
|
|
|
|
2006-04-25 00:59:33 +02:00
|
|
|
Example
|
|
|
|
~~~~~~~
|
|
|
|
|
|
|
|
# Core variables
|
|
|
|
[core]
|
|
|
|
; Don't trust file modes
|
|
|
|
filemode = false
|
|
|
|
|
|
|
|
# Our diff algorithm
|
|
|
|
[diff]
|
2008-07-27 13:12:15 +02:00
|
|
|
external = /usr/local/bin/diff-wrapper
|
2006-04-25 00:59:33 +02:00
|
|
|
renames = true
|
|
|
|
|
2006-12-07 07:36:55 +01:00
|
|
|
[branch "devel"]
|
|
|
|
remote = origin
|
|
|
|
merge = refs/heads/devel
|
|
|
|
|
2007-01-22 16:25:47 +01:00
|
|
|
# Proxy settings
|
|
|
|
[core]
|
2007-08-03 00:45:56 +02:00
|
|
|
gitProxy="ssh" for "kernel.org"
|
2007-01-22 16:25:47 +01:00
|
|
|
gitProxy=default-proxy ; for the rest
|
2006-12-07 07:36:55 +01:00
|
|
|
|
config: add include directive
It can be useful to split your ~/.gitconfig across multiple
files. For example, you might have a "main" file which is
used on many machines, but a small set of per-machine
tweaks. Or you may want to make some of your config public
(e.g., clever aliases) while keeping other data back (e.g.,
your name or other identifying information). Or you may want
to include a number of config options in some subset of your
repos without copying and pasting (e.g., you want to
reference them from the .git/config of participating repos).
This patch introduces an include directive for config files.
It looks like:
[include]
path = /path/to/file
This is syntactically backwards-compatible with existing git
config parsers (i.e., they will see it as another config
entry and ignore it unless you are looking up include.path).
The implementation provides a "git_config_include" callback
which wraps regular config callbacks. Callers can pass it to
git_config_from_file, and it will transparently follow any
include directives, passing all of the discovered options to
the real callback.
Include directives are turned on automatically for "regular"
git config parsing. This includes calls to git_config, as
well as calls to the "git config" program that do not
specify a single file (e.g., using "-f", "--global", etc).
They are not turned on in other cases, including:
1. Parsing of other config-like files, like .gitmodules.
There isn't a real need, and I'd rather be conservative
and avoid unnecessary incompatibility or confusion.
2. Reading single files via "git config". This is for two
reasons:
a. backwards compatibility with scripts looking at
config-like files.
b. inspection of a specific file probably means you
care about just what's in that file, not a general
lookup for "do we have this value anywhere at
all". If that is not the case, the caller can
always specify "--includes".
3. Writing files via "git config"; we want to treat
include.* variables as literal items to be copied (or
modified), and not expand them. So "git config
--unset-all foo.bar" would operate _only_ on
.git/config, not any of its included files (just as it
also does not operate on ~/.gitconfig).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-06 10:54:04 +01:00
|
|
|
[include]
|
|
|
|
path = /path/to/foo.inc ; include by absolute path
|
2017-05-11 11:14:30 +02:00
|
|
|
path = foo.inc ; find "foo.inc" relative to the current file
|
|
|
|
path = ~/foo.inc ; find "foo.inc" in your `$HOME` directory
|
config: add include directive
It can be useful to split your ~/.gitconfig across multiple
files. For example, you might have a "main" file which is
used on many machines, but a small set of per-machine
tweaks. Or you may want to make some of your config public
(e.g., clever aliases) while keeping other data back (e.g.,
your name or other identifying information). Or you may want
to include a number of config options in some subset of your
repos without copying and pasting (e.g., you want to
reference them from the .git/config of participating repos).
This patch introduces an include directive for config files.
It looks like:
[include]
path = /path/to/file
This is syntactically backwards-compatible with existing git
config parsers (i.e., they will see it as another config
entry and ignore it unless you are looking up include.path).
The implementation provides a "git_config_include" callback
which wraps regular config callbacks. Callers can pass it to
git_config_from_file, and it will transparently follow any
include directives, passing all of the discovered options to
the real callback.
Include directives are turned on automatically for "regular"
git config parsing. This includes calls to git_config, as
well as calls to the "git config" program that do not
specify a single file (e.g., using "-f", "--global", etc).
They are not turned on in other cases, including:
1. Parsing of other config-like files, like .gitmodules.
There isn't a real need, and I'd rather be conservative
and avoid unnecessary incompatibility or confusion.
2. Reading single files via "git config". This is for two
reasons:
a. backwards compatibility with scripts looking at
config-like files.
b. inspection of a specific file probably means you
care about just what's in that file, not a general
lookup for "do we have this value anywhere at
all". If that is not the case, the caller can
always specify "--includes".
3. Writing files via "git config"; we want to treat
include.* variables as literal items to be copied (or
modified), and not expand them. So "git config
--unset-all foo.bar" would operate _only_ on
.git/config, not any of its included files (just as it
also does not operate on ~/.gitconfig).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-06 10:54:04 +01:00
|
|
|
|
config: add conditional include
Sometimes a set of repositories want to share configuration settings
among themselves that are distinct from other such sets of repositories.
A user may work on two projects, each of which have multiple
repositories, and use one user.email for one project while using another
for the other.
Setting $GIT_DIR/.config works, but if the penalty of forgetting to
update $GIT_DIR/.config is high (especially when you end up cloning
often), it may not be the best way to go. Having the settings in
~/.gitconfig, which would work for just one set of repositories, would
not well in such a situation. Having separate ${HOME}s may add more
problems than it solves.
Extend the include.path mechanism that lets a config file include
another config file, so that the inclusion can be done only when some
conditions hold. Then ~/.gitconfig can say "include config-project-A
only when working on project-A" for each project A the user works on.
In this patch, the only supported grouping is based on $GIT_DIR (in
absolute path), so you would need to group repositories by directory, or
something like that to take advantage of it.
We already have include.path for unconditional includes. This patch goes
with includeIf.<condition>.path to make it clearer that a condition is
required. The new config has the same backward compatibility approach as
include.path: older git versions that don't understand includeIf will
simply ignore them.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-01 12:26:31 +01:00
|
|
|
; include if $GIT_DIR is /path/to/foo/.git
|
|
|
|
[includeIf "gitdir:/path/to/foo/.git"]
|
|
|
|
path = /path/to/foo.inc
|
|
|
|
|
|
|
|
; include for all repositories inside /path/to/group
|
|
|
|
[includeIf "gitdir:/path/to/group/"]
|
|
|
|
path = /path/to/foo.inc
|
|
|
|
|
|
|
|
; include for all repositories inside $HOME/to/group
|
|
|
|
[includeIf "gitdir:~/to/group/"]
|
|
|
|
path = /path/to/foo.inc
|
2015-03-04 19:57:43 +01:00
|
|
|
|
2017-05-11 11:11:06 +02:00
|
|
|
; relative paths are always relative to the including
|
|
|
|
; file (if the condition is true); their location is not
|
|
|
|
; affected by the condition
|
|
|
|
[includeIf "gitdir:/path/to/group/"]
|
|
|
|
path = foo.inc
|
|
|
|
|
2015-03-04 19:57:43 +01:00
|
|
|
Values
|
|
|
|
~~~~~~
|
|
|
|
|
|
|
|
Values of many variables are treated as a simple string, but there
|
|
|
|
are variables that take values of specific types and there are rules
|
|
|
|
as to how to spell them.
|
|
|
|
|
|
|
|
boolean::
|
|
|
|
|
|
|
|
When a variable is said to take a boolean value, many
|
|
|
|
synonyms are accepted for 'true' and 'false'; these are all
|
|
|
|
case-insensitive.
|
|
|
|
|
2017-08-15 00:12:18 +02:00
|
|
|
true;; Boolean true literals are `yes`, `on`, `true`,
|
|
|
|
and `1`. Also, a variable defined without `= <value>`
|
2015-03-04 19:57:43 +01:00
|
|
|
is taken as true.
|
|
|
|
|
2017-08-15 00:12:18 +02:00
|
|
|
false;; Boolean false literals are `no`, `off`, `false`,
|
|
|
|
`0` and the empty string.
|
2015-03-04 19:57:43 +01:00
|
|
|
+
|
2018-09-19 18:38:18 +02:00
|
|
|
When converting a value to its canonical form using the `--type=bool` type
|
2017-08-15 00:12:18 +02:00
|
|
|
specifier, 'git config' will ensure that the output is "true" or
|
2015-03-04 19:57:43 +01:00
|
|
|
"false" (spelled in lowercase).
|
|
|
|
|
|
|
|
integer::
|
|
|
|
The value for many variables that specify various sizes can
|
|
|
|
be suffixed with `k`, `M`,... to mean "scale the number by
|
|
|
|
1024", "by 1024x1024", etc.
|
|
|
|
|
2015-03-04 08:07:13 +01:00
|
|
|
color::
|
2016-06-23 19:32:30 +02:00
|
|
|
The value for a variable that takes a color is a list of
|
|
|
|
colors (at most two, one for foreground and one for background)
|
|
|
|
and attributes (as many as you want), separated by spaces.
|
2015-03-20 21:50:51 +01:00
|
|
|
+
|
2016-06-23 19:32:30 +02:00
|
|
|
The basic colors accepted are `normal`, `black`, `red`, `green`, `yellow`,
|
|
|
|
`blue`, `magenta`, `cyan` and `white`. The first color given is the
|
|
|
|
foreground; the second is the background.
|
log --decorate: do not leak "commit" color into the next item
In "git log --decorate", you would see the commit header like this:
commit ... (HEAD, jc/decorate-leaky-separator-color)
where "commit ... (" is painted in color.diff.commit, "HEAD" in
color.decorate.head, ", " in color.diff.commit, the branch name in
color.decorate.branch and then closing ")" in color.diff.commit.
If you wanted to paint the HEAD and local branch name in the same
color as the body text (perhaps because cyan and green are too faint
on a black-on-white terminal to be readable), you would not want to
have to say
[color "decorate"]
head = black
branch = black
because that you would not be able to reuse same configuration on a
white-on-black terminal. You would naively expect
[color "decorate"]
head = normal
branch = normal
to work, but unfortunately it does not. It paints the string "HEAD"
and the branch name in the same color as the opening parenthesis or
comma between the decoration elements. This is because the code
forgets to reset the color after printing the "prefix" in its own
color.
It theoretically is possible that some people were expecting and
relying on that the attribute set as the "diff.commit" color, which
is used to draw these opening parenthesis and inter-item comma, is
inherited by the drawing of branch names, but it is not how the
coloring works everywhere else.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-04 20:07:12 +01:00
|
|
|
+
|
2016-06-23 19:32:30 +02:00
|
|
|
Colors may also be given as numbers between 0 and 255; these use ANSI
|
|
|
|
256-color mode (but note that not all terminals may support this). If
|
|
|
|
your terminal supports it, you may also specify 24-bit RGB values as
|
|
|
|
hex, like `#ff0ab3`.
|
|
|
|
+
|
2016-06-23 19:40:16 +02:00
|
|
|
The accepted attributes are `bold`, `dim`, `ul`, `blink`, `reverse`,
|
|
|
|
`italic`, and `strike` (for crossed-out or "strikethrough" letters).
|
|
|
|
The position of any attributes with respect to the colors
|
2016-06-23 19:39:07 +02:00
|
|
|
(before, after, or in between), doesn't matter. Specific attributes may
|
|
|
|
be turned off by prefixing them with `no` or `no-` (e.g., `noreverse`,
|
|
|
|
`no-ul`, etc).
|
2016-06-23 19:32:30 +02:00
|
|
|
+
|
2017-02-02 13:42:44 +01:00
|
|
|
An empty color string produces no color effect at all. This can be used
|
|
|
|
to avoid coloring specific elements without disabling color entirely.
|
|
|
|
+
|
2016-06-23 19:32:30 +02:00
|
|
|
For git's pre-defined color slots, the attributes are meant to be reset
|
|
|
|
at the beginning of each item in the colored output. So setting
|
|
|
|
`color.decorate.branch` to `black` will paint that branch name in a
|
|
|
|
plain `black`, even if the previous thing on the same output line (e.g.
|
|
|
|
opening parenthesis before the list of branch names in `log --decorate`
|
|
|
|
output) is set to be painted with `bold` or some other attribute.
|
|
|
|
However, custom log formats may do more complicated and layered
|
|
|
|
coloring, and the negated forms may be useful there.
|
2015-03-04 08:07:13 +01:00
|
|
|
|
2016-04-29 19:43:55 +02:00
|
|
|
pathname::
|
|
|
|
A variable that takes a pathname value can be given a
|
|
|
|
string that begins with "`~/`" or "`~user/`", and the usual
|
|
|
|
tilde expansion happens to such a string: `~/`
|
|
|
|
is expanded to the value of `$HOME`, and `~user/` to the
|
|
|
|
specified user's home directory.
|
|
|
|
|
2015-03-04 19:57:43 +01:00
|
|
|
|
2006-04-25 00:59:33 +02:00
|
|
|
Variables
|
|
|
|
~~~~~~~~~
|
|
|
|
|
|
|
|
Note that this list is non-comprehensive and not necessarily complete.
|
2006-06-08 01:15:05 +02:00
|
|
|
For command-specific variables, you will find a more detailed description
|
2014-03-21 05:07:08 +01:00
|
|
|
in the appropriate manual page.
|
|
|
|
|
|
|
|
Other git-related tools may and do use their own variables. When
|
|
|
|
inventing new variables for use in your own tool, make sure their
|
|
|
|
names do not conflict with those that are used by Git itself and
|
|
|
|
other popular tools, and describe them in your documentation.
|
|
|
|
|
2018-10-27 08:22:35 +02:00
|
|
|
include::config/advice.txt[]
|
2009-09-09 13:38:58 +02:00
|
|
|
|
2018-10-27 08:22:36 +02:00
|
|
|
include::config/core.txt[]
|
2010-10-28 20:28:04 +02:00
|
|
|
|
2018-10-27 08:22:37 +02:00
|
|
|
include::config/add.txt[]
|
2009-05-31 07:08:02 +02:00
|
|
|
|
2018-10-27 08:22:38 +02:00
|
|
|
include::config/alias.txt[]
|
2007-02-11 01:33:58 +01:00
|
|
|
|
2018-10-27 08:22:39 +02:00
|
|
|
include::config/am.txt[]
|
2015-08-04 16:19:26 +02:00
|
|
|
|
2018-10-27 08:22:40 +02:00
|
|
|
include::config/apply.txt[]
|
2006-04-25 00:59:33 +02:00
|
|
|
|
2018-10-27 08:22:41 +02:00
|
|
|
include::config/blame.txt[]
|
2018-08-04 08:25:00 +02:00
|
|
|
|
2018-10-27 08:22:42 +02:00
|
|
|
include::config/branch.txt[]
|
2013-01-01 10:30:53 +01:00
|
|
|
|
2018-10-27 08:22:43 +02:00
|
|
|
include::config/browser.txt[]
|
2008-01-29 07:08:22 +01:00
|
|
|
|
2018-10-27 08:22:44 +02:00
|
|
|
include::config/checkout.txt[]
|
2018-08-16 20:27:11 +02:00
|
|
|
|
2018-10-27 08:22:45 +02:00
|
|
|
include::config/clean.txt[]
|
2007-04-24 02:18:16 +02:00
|
|
|
|
2018-10-27 08:22:46 +02:00
|
|
|
include::config/color.txt[]
|
2008-02-18 08:26:03 +01:00
|
|
|
|
2018-10-27 08:22:47 +02:00
|
|
|
include::config/column.txt[]
|
2012-04-13 12:54:41 +02:00
|
|
|
|
2018-10-27 08:22:48 +02:00
|
|
|
include::config/commit.txt[]
|
2016-05-05 11:50:02 +02:00
|
|
|
|
2018-10-27 08:22:49 +02:00
|
|
|
include::config/credential.txt[]
|
2015-11-10 01:26:29 +01:00
|
|
|
|
2018-10-27 08:22:50 +02:00
|
|
|
include::config/completion.txt[]
|
2018-05-20 20:40:09 +02:00
|
|
|
|
2018-10-27 08:22:51 +02:00
|
|
|
include::config/diff.txt[]
|
2009-04-07 10:21:20 +02:00
|
|
|
|
2018-10-27 08:22:52 +02:00
|
|
|
include::config/difftool.txt[]
|
2009-04-07 10:21:22 +02:00
|
|
|
|
2018-10-27 08:22:53 +02:00
|
|
|
include::config/fastimport.txt[]
|
2016-04-25 23:17:28 +02:00
|
|
|
|
2018-10-27 08:22:54 +02:00
|
|
|
include::config/fetch.txt[]
|
2018-07-16 20:44:01 +02:00
|
|
|
|
2018-10-27 08:22:56 +02:00
|
|
|
include::config/format.txt[]
|
2016-04-26 09:51:24 +02:00
|
|
|
|
2018-10-27 08:22:55 +02:00
|
|
|
include::config/filter.txt[]
|
2011-04-06 20:46:48 +02:00
|
|
|
|
2018-10-27 08:22:58 +02:00
|
|
|
include::config/fsck.txt[]
|
2015-06-22 17:27:23 +02:00
|
|
|
|
2018-10-27 08:22:59 +02:00
|
|
|
include::config/gc.txt[]
|
2006-12-27 10:24:05 +01:00
|
|
|
|
2018-10-27 08:23:00 +02:00
|
|
|
include::config/gitcvs.txt[]
|
2007-04-13 18:13:42 +02:00
|
|
|
|
2018-10-27 08:23:01 +02:00
|
|
|
include::config/gitweb.txt[]
|
2011-10-16 13:07:34 +02:00
|
|
|
|
2018-10-27 08:23:02 +02:00
|
|
|
include::config/grep.txt[]
|
2016-01-12 11:40:26 +01:00
|
|
|
|
2018-10-27 08:23:03 +02:00
|
|
|
include::config/gpg.txt[]
|
2018-07-17 14:50:11 +02:00
|
|
|
|
2018-10-27 08:23:04 +02:00
|
|
|
include::config/gui.txt[]
|
2008-11-13 18:28:49 +01:00
|
|
|
|
2018-10-27 08:23:05 +02:00
|
|
|
include::config/guitool.txt[]
|
2008-12-14 20:44:32 +01:00
|
|
|
|
2018-10-27 08:23:06 +02:00
|
|
|
include::config/help.txt[]
|
2013-01-15 21:56:21 +01:00
|
|
|
|
2018-10-27 08:23:08 +02:00
|
|
|
include::config/http.txt[]
|
2013-08-05 22:20:36 +02:00
|
|
|
|
2018-10-27 08:23:09 +02:00
|
|
|
include::config/i18n.txt[]
|
2006-12-28 01:41:33 +01:00
|
|
|
|
2018-10-27 08:23:10 +02:00
|
|
|
include::config/imap.txt[]
|
2008-11-26 09:26:50 +01:00
|
|
|
|
2018-10-27 08:23:11 +02:00
|
|
|
include::config/index.txt[]
|
2014-02-23 21:49:59 +01:00
|
|
|
|
2018-10-27 08:23:12 +02:00
|
|
|
include::config/init.txt[]
|
2010-02-17 00:44:46 +01:00
|
|
|
|
2018-10-27 08:23:13 +02:00
|
|
|
include::config/instaweb.txt[]
|
2008-01-08 04:55:14 +01:00
|
|
|
|
2018-10-27 08:23:14 +02:00
|
|
|
include::config/interactive.txt[]
|
2016-02-27 06:37:06 +01:00
|
|
|
|
2018-10-27 08:23:15 +02:00
|
|
|
include::config/log.txt[]
|
2013-01-05 22:26:46 +01:00
|
|
|
|
2018-10-27 08:23:16 +02:00
|
|
|
include::config/mailinfo.txt[]
|
2015-02-20 20:32:20 +01:00
|
|
|
|
2018-10-27 08:23:17 +02:00
|
|
|
include::config/mailmap.txt[]
|
2012-12-12 12:04:04 +01:00
|
|
|
|
2018-10-27 08:23:18 +02:00
|
|
|
include::config/man.txt[]
|
2008-04-25 08:24:41 +02:00
|
|
|
|
2018-10-27 08:23:19 +02:00
|
|
|
include::config/merge.txt[]
|
2008-08-29 19:49:56 +02:00
|
|
|
|
2018-10-27 08:23:20 +02:00
|
|
|
include::config/mergetool.txt[]
|
2008-11-13 13:41:14 +01:00
|
|
|
|
2018-10-27 08:23:21 +02:00
|
|
|
include::config/notes.txt[]
|
2010-03-12 18:04:32 +01:00
|
|
|
|
2018-10-27 08:23:22 +02:00
|
|
|
include::config/pack.txt[]
|
pack-bitmap: implement optional name_hash cache
When we use pack bitmaps rather than walking the object
graph, we end up with the list of objects to include in the
packfile, but we do not know the path at which any tree or
blob objects would be found.
In a recently packed repository, this is fine. A fetch would
use the paths only as a heuristic in the delta compression
phase, and a fully packed repository should not need to do
much delta compression.
As time passes, though, we may acquire more objects on top
of our large bitmapped pack. If clients fetch frequently,
then they never even look at the bitmapped history, and all
works as usual. However, a client who has not fetched since
the last bitmap repack will have "have" tips in the
bitmapped history, but "want" newer objects.
The bitmaps themselves degrade gracefully in this
circumstance. We manually walk the more recent bits of
history, and then use bitmaps when we hit them.
But we would also like to perform delta compression between
the newer objects and the bitmapped objects (both to delta
against what we know the user already has, but also between
"new" and "old" objects that the user is fetching). The lack
of pathnames makes our delta heuristics much less effective.
This patch adds an optional cache of the 32-bit name_hash
values to the end of the bitmap file. If present, a reader
can use it to match bitmapped and non-bitmapped names during
delta compression.
Here are perf results for p5310:
Test origin/master HEAD^ HEAD
-------------------------------------------------------------------------------------------------
5310.2: repack to disk 36.81(37.82+1.43) 47.70(48.74+1.41) +29.6% 47.75(48.70+1.51) +29.7%
5310.3: simulated clone 30.78(29.70+2.14) 1.08(0.97+0.10) -96.5% 1.07(0.94+0.12) -96.5%
5310.4: simulated fetch 3.16(6.10+0.08) 3.54(10.65+0.06) +12.0% 1.70(3.07+0.06) -46.2%
5310.6: partial bitmap 36.76(43.19+1.81) 6.71(11.25+0.76) -81.7% 4.08(6.26+0.46) -88.9%
You can see that the time spent on an incremental fetch goes
down, as our delta heuristics are able to do their work.
And we save time on the partial bitmap clone for the same
reason.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-21 15:00:45 +01:00
|
|
|
|
2018-10-27 08:23:23 +02:00
|
|
|
include::config/pager.txt[]
|
2008-08-16 04:14:33 +02:00
|
|
|
|
2018-10-27 08:23:24 +02:00
|
|
|
include::config/pretty.txt[]
|
2010-05-02 13:00:44 +02:00
|
|
|
|
2018-10-27 08:23:25 +02:00
|
|
|
include::config/protocol.txt[]
|
2017-10-16 19:55:24 +02:00
|
|
|
|
2018-10-27 08:23:26 +02:00
|
|
|
include::config/pull.txt[]
|
2017-10-23 13:44:49 +02:00
|
|
|
|
2018-10-27 08:23:27 +02:00
|
|
|
include::config/push.txt[]
|
2015-11-17 12:05:56 +01:00
|
|
|
|
2018-10-27 08:23:28 +02:00
|
|
|
include::config/rebase.txt[]
|
2015-06-13 18:26:58 +02:00
|
|
|
|
2018-10-27 08:23:29 +02:00
|
|
|
include::config/receive.txt[]
|
2013-12-05 14:02:47 +01:00
|
|
|
|
2018-10-27 08:23:30 +02:00
|
|
|
include::config/remote.txt[]
|
2013-07-13 11:36:24 +02:00
|
|
|
|
2018-10-27 08:23:31 +02:00
|
|
|
include::config/remotes.txt[]
|
2007-02-20 21:13:43 +01:00
|
|
|
|
2018-10-27 08:23:32 +02:00
|
|
|
include::config/repack.txt[]
|
repack: add `repack.packKeptObjects` config var
The git-repack command always passes `--honor-pack-keep`
to pack-objects. This has traditionally been a good thing,
as we do not want to duplicate those objects in a new pack,
and we are not going to delete the old pack.
However, when bitmaps are in use, it is important for a full
repack to include all reachable objects, even if they may be
duplicated in a .keep pack. Otherwise, we cannot generate
the bitmaps, as the on-disk format requires the set of
objects in the pack to be fully closed.
Even if the repository does not generally have .keep files,
a simultaneous push could cause a race condition in which a
.keep file exists at the moment of a repack. The repack may
try to include those objects in one of two situations:
1. The pushed .keep pack contains objects that were
already in the repository (e.g., blobs due to a revert of
an old commit).
2. Receive-pack updates the refs, making the objects
reachable, but before it removes the .keep file, the
repack runs.
In either case, we may prefer to duplicate some objects in
the new, full pack, and let the next repack (after the .keep
file is cleaned up) take care of removing them.
This patch introduces both a command-line and config option
to disable the `--honor-pack-keep` option. By default, it
is triggered when pack.writeBitmaps (or `--write-bitmap-index`
is turned on), but specifying it explicitly can override the
behavior (e.g., in cases where you prefer .keep files to
bitmaps, but only when they are present).
Note that this option just disables the pack-objects
behavior. We still leave packs with a .keep in place, as we
do not necessarily know that we have duplicated all of their
objects.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-03 21:04:20 +01:00
|
|
|
|
2018-10-27 08:23:33 +02:00
|
|
|
include::config/rerere.txt[]
|
2008-11-26 09:26:50 +01:00
|
|
|
|
2018-10-27 08:23:34 +02:00
|
|
|
include::config/reset.txt[]
|
2018-10-23 21:04:22 +02:00
|
|
|
|
2018-10-27 08:23:35 +02:00
|
|
|
include::config/sendemail.txt[]
|
2017-05-21 14:59:50 +02:00
|
|
|
|
2018-10-27 08:23:36 +02:00
|
|
|
include::config/sequencer.txt[]
|
2018-08-22 18:06:04 +02:00
|
|
|
|
2018-10-27 08:23:37 +02:00
|
|
|
include::config/showbranch.txt[]
|
2006-04-25 00:59:33 +02:00
|
|
|
|
2018-10-27 08:23:38 +02:00
|
|
|
include::config/splitindex.txt[]
|
2017-03-06 10:42:02 +01:00
|
|
|
|
2018-10-27 08:23:07 +02:00
|
|
|
include::config/ssh.txt[]
|
|
|
|
|
2018-10-27 08:23:39 +02:00
|
|
|
include::config/status.txt[]
|
2010-05-20 17:55:42 +02:00
|
|
|
|
2018-10-27 08:23:40 +02:00
|
|
|
include::config/stash.txt[]
|
2015-08-29 17:25:57 +02:00
|
|
|
|
2018-10-27 08:23:41 +02:00
|
|
|
include::config/submodule.txt[]
|
2016-08-18 00:45:35 +02:00
|
|
|
|
2018-10-27 08:23:42 +02:00
|
|
|
include::config/tag.txt[]
|
2006-07-20 11:30:44 +02:00
|
|
|
|
2018-10-27 08:23:43 +02:00
|
|
|
include::config/transfer.txt[]
|
2008-11-26 09:26:50 +01:00
|
|
|
|
2018-10-27 08:23:44 +02:00
|
|
|
include::config/uploadarchive.txt[]
|
add uploadarchive.allowUnreachable option
In commit ee27ca4, we started restricting remote git-archive
invocations to only accessing reachable commits. This
matches what upload-pack allows, but does restrict some
useful cases (e.g., HEAD:foo). We loosened this in 0f544ee,
which allows `foo:bar` as long as `foo` is a ref tip.
However, that still doesn't allow many useful things, like:
1. Commits accessible from a ref, like `foo^:bar`, which
are reachable
2. Arbitrary sha1s, even if they are reachable.
We can do a full object-reachability check for these cases,
but it can be quite expensive if the client has sent us the
sha1 of a tree; we have to visit every sub-tree of every
commit in the worst case.
Let's instead give site admins an escape hatch, in case they
prefer the more liberal behavior. For many sites, the full
object database is public anyway (e.g., if you allow dumb
walker access), or the site admin may simply decide the
security/convenience tradeoff is not worth it.
This patch adds a new config option to disable the
restrictions added in ee27ca4. It defaults to off, meaning
there is no change in behavior by default.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-02-28 11:04:19 +01:00
|
|
|
|
2018-10-27 08:23:45 +02:00
|
|
|
include::config/uploadpack.txt[]
|
2018-06-28 00:30:17 +02:00
|
|
|
|
2018-10-27 08:23:46 +02:00
|
|
|
include::config/url.txt[]
|
2009-09-07 10:56:33 +02:00
|
|
|
|
2018-10-27 08:23:47 +02:00
|
|
|
include::config/user.txt[]
|
2007-01-26 15:13:46 +01:00
|
|
|
|
2018-10-27 08:23:48 +02:00
|
|
|
include::config/versionsort.txt[]
|
2015-02-26 11:44:01 +01:00
|
|
|
|
2018-10-27 08:23:49 +02:00
|
|
|
include::config/web.txt[]
|
2017-11-29 21:04:51 +01:00
|
|
|
|
2018-10-27 08:23:50 +02:00
|
|
|
include::config/worktree.txt[]
|