GIT-CONFIG(1)
๐ GIT-CONFIG(1) ๐
okay bestie, welcome to GIT-CONFIG(1) straight from the Git Manual โ the page about getting and setting repository or global options. it's giving config-file main character energy, and we're gonna read it like a group chat. ๐
โจ NAME โจ
git-config โ Get and set repository or global options
๐ธ SYNOPSIS ๐ธ
git config list [<file-option>] [<display-option>] [--includes]
git config get [<file-option>] [<display-option>] [--includes] [--all] [--regexp] [--value=<pattern>] [--fixed-value] [--default=<default>] [--url=<url>] <name>
git config set [<file-option>] [--type=<type>] [--all] [--value=<pattern>] [--fixed-value] <name> <value>
git config unset [<file-option>] [--all] [--value=<pattern>] [--fixed-value] <name>
git config rename-section [<file-option>] <old-name> <new-name>
git config remove-section [<file-option>] <name>
git config edit [<file-option>]
git config [<file-option>] --get-colorbool <name> [<stdout-is-tty>]
๐ฆ DESCRIPTION ๐ฆ
so here's the vibe: you can query, set, replace, and unset options with this command. The name is actually the section and the key separated by a dot, and the value will be escaped. periodt.
Multiple lines can be added to an option by using the --append option. If you want to update or unset an option which can occur on multiple lines, --value=<pattern> needs to be given โ and that pattern is an extended regular expression, unless the --fixed-value option is given. Only the existing values that match the pattern are updated or unset. If you want to handle the lines that do not match the pattern, just prepend a single exclamation mark in front (see also the section called โEXAMPLESโ), but note that this only works when the --fixed-value option is not in use.
The --type=<type> option tells git config to make sure incoming and outgoing values are canonicalize-able under the given <type>. If no --type=<type> is given, no canonicalization will be performed. Callers may unset an existing --type specifier with --no-type.
When reading, the values are read from the system, global and repository local configuration files by default, and options --system, --global, --local, --worktree and --file <filename> can be used to tell the command to read from only that location (see the section called โFILESโ).
When writing, the new value is written to the repository local configuration file by default, and options --system, --global, --worktree, --file <filename> can be used to tell the command to write to that location (you can say --local but that is the default).
This command will fail with non-zero status upon error. Some exit codes are:
- The section or key is invalid (
ret=1), - no section or name was provided (
ret=2), - the config file is invalid (
ret=3), - the config file cannot be written (
ret=4), - you try to unset an option which does not exist (
ret=5), - you try to unset/set an option for which multiple lines match (
ret=5), or - you try to use an invalid regexp (
ret=6).
On success, the command returns the exit code 0.
A list of all available configuration variables can be obtained using the git help --config command.
๐ COMMANDS ๐
listโ lists all variables set in config file, along with their values.getโ emits the value of the specified key. If key is present multiple times in the configuration, it emits the last value. If--allis specified, it emits all values associated with key. Returns error code1if key is not present.setโ sets value for one or more config options. By default, this command refuses to write multi-valued config options. Passing--allwill replace all multi-valued config options with the new value, whereas--value=will replace all config options whose values match the given pattern.unsetโ unsets value for one or more config options. By default, this command refuses to unset multi-valued keys. Passing--allwill unset all multi-valued config options, whereas--valuewill unset all config options whose values match the given pattern.rename-sectionโ renames the given section to a new name.remove-sectionโ removes the given section from the configuration file.editโ opens an editor to modify the specified config file; either--system,--global,--local(default),--worktree, or--file <config-file>.
โจ OPTIONS โจ
okay bestie, this is the big one โ every single flag, no skipping, i promise ๐
--replace-allโ so the default vibe is "replace at most one line", right? This one goes off and replaces all the lines matching the key (and optionally--value=<pattern>). all of them. every last one. ๐ฅ--appendโ adds a new line to the option without touching any existing values, like, at all. it's literally the same as passing--value=^$toset. no cap.--comment <message>โ drops a comment at the end of new or modified lines ๐- if
<message>starts with one or more whitespaces followed by#, it gets used as-is. - if it starts with
#, a space gets prepended before it's used. - otherwise, the string
" # "(a space, a hash, a space) gets prepended to it. - the resulting string lands immediately after the value defined for the variable.
- if
โ ๏ธ <message> must NOT contain linefeed characters โ no multi-line comments, periodt. ๐ญ
--allโ withget, returns all the values for a multi-valued key. all of them, bestie.--regexpโ withget, treats the name as a regular expression. heads up: matching is currently case-sensitive, and it's done against a canonicalized version of the key where section and variable names are lowercased โ but subsection names are not. iykyk ๐ฆ--url=<URL>โ when you give a two-part<name>as<section>.<key>, it returns the value for<section>.<URL>.<key>whose<URL>part matches the given URL best (and if no such key exists, the value for<section>.<key>is used as a fallback). when you give just the<section>as the name, it does that for all the keys in the section and lists them. returns error code1if no value is found. ๐--globalโ for writing options: writes to the global~/.gitconfigfile instead of the repository.git/config, and writes to$XDG_CONFIG_HOME/git/configif that file exists and~/.gitconfigdoesn't. for reading options: reads only from global~/.gitconfigand from$XDG_CONFIG_HOME/git/configinstead of from all available files. see also the section called "FILES" ๐ซถ--systemโ for writing options: writes to system-wide$(prefix)/etc/gitconfiginstead of the repository.git/config. for reading options: reads only from system-wide$(prefix)/etc/gitconfiginstead of from all available files. also see "FILES" โจ--localโ for writing options: writes to the repository.git/configfile. this is the default behavior, main character energy fr. for reading options: reads only from the repository.git/configinstead of from all available files. "FILES" section again, you know the drill ๐--worktreeโ similar to--localexcept that$GIT_DIR/config.worktreeis read from or written to ifextensions.worktreeConfigis enabled. if it's not enabled, it's the same as--local. note that$GIT_DIRis equal to$GIT_COMMON_DIRfor the main working tree, but it's of the form$GIT_DIR/worktrees/<id>/for other working trees ๐. seegit-worktree(1)to learn how to enableextensions.worktreeConfig.-f <config-file>,--file <config-file>โ for writing options: writes to the specified file instead of the repository.git/config. for reading options: reads only from the specified file instead of from all available files. yes, "FILES" section, love that for us ๐--blob <blob>โ like--filebut uses the given blob instead of a file. e.g. you can usemaster:.gitmodulesto read values from the file.gitmodulesin themasterbranch ๐. see the "SPECIFYING REVISIONS" section ingitrevisions(7)for a more complete list of ways to spell blob names.--value=<pattern>,--no-valueโ withget,set, andunset, matches only against<pattern>. the pattern is an extended regular expression unless--fixed-valueis given. and use--no-valueto unset<pattern>. ๐ง--fixed-valueโ when used with--value=<pattern>, treats<pattern>as an exact string instead of a regular expression. this restricts the name/value pairs that get matched to only those where the value is exactly equal to<pattern>. no fuzzy vibes allowed ๐--type <type>โgit configwill make sure any input or output is valid under the given type constraint(s), and will canonicalize outgoing values into<type>'s canonical form. valid<type>'s include:bool: canonicalizes valuestrue,yes,on, and positive numbers as"true", and valuesfalse,no,offand0as"false". โญint: canonicalizes values as simple decimal numbers. an optional suffix ofk,m, orgcauses the value to be multiplied by1024,1048576, or1073741824upon input.bool-or-int: canonicalizes according to eitherboolorint, as described above.path: canonicalizes by expanding a leading~to the value of$HOMEand~userto the home directory for the specified user. this specifier has no effect when setting the value (but you can usegit config section.variable ~/from the command line to let your shell do the expansion ๐).expiry-date: canonicalizes by converting from a fixed or relative date-string to a timestamp. this specifier has no effect when setting the value.color: when getting a value, canonicalizes by converting to an ANSI color escape sequence. when setting a value, a sanity-check is performed to ensure the given value is canonicalize-able as an ANSI color โ but it's written as-is.
and if the command is in list mode, then the --type <type> argument applies to each listed config value ๐ฆ. if a value doesn't successfully parse in that format, it gets omitted from the list. bye bestie ๐
--bool,--int,--bool-or-int,--path,--expiry-dateโ historical options for selecting a type specifier. prefer--typeinstead (see above), these are giving vintage ๐--no-typeโ un-sets the previously set type specifier (if one was previously set). this option requests thatgit confignot canonicalize the retrieved variable. and heads up:--no-typehas no effect without--type=<type>or--<type>.-z,--nullโ for all options that output values and/or keys, always ends values with the null character (instead of a newline), and uses a newline instead as the delimiter between key and value. this allows for secure parsing of the output without getting confused by, like, values that contain line breaks. iconic for scripting ๐ฅ--name-onlyโ outputs only the names of config variables forlistorget. short and sweet.--show-names,--no-show-namesโ withget, shows config keys in addition to their values. the default is--no-show-namesunless--urlis given and there are no subsections in<name>๐--show-originโ augments the output of all queried config options with the origin type (file,standard input,blob,command line) and the actual origin (config file path, ref, or blob id if applicable). receipts, basically ๐งพโจ--show-scopeโ similar to--show-originin that it augments the output of all queried config options with the scope of that value (worktree,local,global,system,command). ๐--get-colorbool <name> [<stdout-is-tty>]โ finds the color setting for<name>(e.g.color.diff) and outputs"true"or"false".<stdout-is-tty>should be either"true"or"false", and it's taken into account when the configuration says"auto". if<stdout-is-tty>is missing, then it checks the standard output of the command itself, and exits with status0if color is to be used, or exits with status1otherwise ๐. when the color setting for name is undefined, the command usescolor.uias fallback.--includes,--no-includesโ respectsinclude.*directives in config files when looking up values. defaults to off when a specific file is given (e.g. using--file,--global, etc) and on when searching all config files. ๐ฆ--default <value>โ when usinggetand the requested variable isn't found, behaves as if<value>were the value assigned to that variable. a little fallback bestie ๐ซถ
๐ DEPRECATED MODES ๐
okay so these modes have been deprecated in favor of subcommands โ it's recommended to migrate to the new syntax, bestie. they're giving flip phone in 2025 ๐ฑ๐
git config <name>โ replaced bygit config get <name>.git config <name> <value> [<value-pattern>]โ replaced bygit config set [--value=<pattern>] <name> <value>.-l,--listโ replaced bygit config list.--get <name> [<value-pattern>]โ replaced bygit config get [--value=<pattern>] <name>.--get-all <name> [<value-pattern>]โ replaced bygit config get [--value=<pattern>] --all <name>.--get-regexp <name-regexp>โ replaced bygit config get --all --show-names --regexp <name-regexp>.--get-urlmatch <name> <URL>โ replaced bygit config get --url=<URL> <name>.--get-color <name> [<default>]โ replaced bygit config get --type=color [--default=<default>] <name>.--add <name> <value>โ replaced bygit config set --append <name> <value>.--unset <name> [<value-pattern>]โ replaced bygit config unset [--value=<pattern>] <name>.--unset-all <name> [<value-pattern>]โ replaced bygit config unset [--value=<pattern>] --all <name>.--rename-section <old-name> <new-name>โ replaced bygit config rename-section <old-name> <new-name>.--remove-section <name>โ replaced bygit config remove-section <name>.-e,--editโ replaced bygit config edit.
๐ CONFIGURATION ๐
tiny section, big vibes: pager.config is only respected when listing configuration โ i.e., when using list or get which may return multiple results ๐
. and the default is to use a pager. that's it, that's the whole thing ๐ฆ
okay bestie, this is the part where we talk about where all this config actually lives โ like the filesystem addresses of your settings ๐
๐๏ธ FILES
So by default, git config doesn't just read one file, it reads a whole lil' stack of them, in order:
$(prefix)/etc/gitconfigโ the system-wide configuration file. The big boss-level one for the whole machine. ๐$XDG_CONFIG_HOME/git/config,~/.gitconfigโ your user-specific configuration files. When theXDG_CONFIG_HOMEenvironment variable is not set or empty,$HOME/.config/is used as$XDG_CONFIG_HOME.
These are also called "global" configuration files. If both files exist, both files are read in the order given above. ๐ซถ
$GIT_DIR/configโ the repository specific configuration file, aka the main character of this repo.$GIT_DIR/config.worktreeโ this one is optional and is only searched whenextensions.worktreeConfigis present in$GIT_DIR/config. Very exclusive, very iykyk. โจ
You may also provide additional configuration parameters when running any git command by using the -c option. See git(1) for details.
Options will be read from all of these files that are available. If the global or the system-wide configuration files are missing or unreadable they will be ignored. If the repository configuration file is missing or unreadable, git config will exit with a non-zero error code. An error message is produced if the file is unreadable, but not if it is missing. (Not me being dramatic about a missing file vs an unreadable one ๐ญ but the distinction is real.)
The files are read in the order given above, with last value found taking precedence over values read earlier. When multiple values are taken then all values of a key from all files will be used. Last one wins, bestie โ classic.
By default, options are only written to the repository specific configuration file. Note that this also affects options like set and unset. git config will only ever change one file at a time. One file. That's it. No multitasking. ๐
You can limit which configuration sources are read from or written to by specifying the path of a file with the --file option, or by specifying a configuration scope with --system, --global, --local, or --worktree. For more, see the section called โOPTIONSโ above.
๐ฏ SCOPES
Every configuration source falls inside a configuration scope. Here's the lineup, no cap:
systemโ$(prefix)/etc/gitconfigglobalโ$XDG_CONFIG_HOME/git/config
~/.gitconfig
localโ$GIT_DIR/configworktreeโ$GIT_DIR/config.worktreecommandโGIT_CONFIG_{COUNT,KEY,VALUE}environment variables (see the section called โENVIRONMENTโ below)
the -c option
With the exception of command, each scope corresponds to a command line option: --system, --global, --local, --worktree. iconic, consistent, organized โจ
When reading options, specifying a scope will only read options from the files within that scope. When writing options, specifying a scope will write to the files within that scope (instead of the repository specific configuration file). See the section called โOPTIONSโ above for a complete description.
Most configuration options are respected regardless of the scope it is defined in, but some options are only respected in certain scopes. See the respective optionโs documentation for the full details. ๐
๐ก๏ธ Protected configuration
Protected configuration refers to the system, global, and command scopes. For security reasons, certain options are only respected when they are specified in protected configuration, and ignored otherwise. Ignored. Otherwise. Periodt.
Git treats these scopes as if they are controlled by the user or a trusted administrator. This is because an attacker who controls these scopes can do substantial harm without using Git, so it is assumed that the userโs environment protects these scopes against attackers. So like, that's the whole security model โ keep your scopes safe, bestie ๐ซถ
๐ฑ ENVIRONMENT
GIT_CONFIG_GLOBAL,GIT_CONFIG_SYSTEMโ take the configuration from the given files instead from global or system-level configuration. Seegit(1)for details. ๐ฆGIT_CONFIG_NOSYSTEMโ whether to skip reading settings from the system-wide$(prefix)/etc/gitconfigfile. Seegit(1)for details.
See also the section called โFILESโ.
GIT_CONFIG_COUNT,GIT_CONFIG_KEY_<n>,GIT_CONFIG_VALUE_<n>โ ifGIT_CONFIG_COUNTis set to a positive number, all environment pairsGIT_CONFIG_KEY_<n>andGIT_CONFIG_VALUE_<n>up to that number will be added to the processโs runtime configuration. The config pairs are zero-indexed. Any missing key or value is treated as an error. An emptyGIT_CONFIG_COUNTis treated the same asGIT_CONFIG_COUNT=0, namely no pairs are processed. These environment variables will override values in configuration files, but will be overridden by any explicit options passed viagit -c.
This is useful for cases where you want to spawn multiple git commands with a common configuration but cannot depend on a configuration file, for example when writing scripts. script girlies rise up ๐
GIT_CONFIGโ if no--fileoption is provided togit config, use the file given byGIT_CONFIGas if it were provided via--file. This variable has no effect on other Git commands, and is mostly for historical compatibility; there is generally no reason to use it instead of the--fileoption. (legacy queen, we still love her, but likeโฆ use--file๐)
๐ EXAMPLES
Okay bestie, imagine a .git/config that looks exactly like this:
#
# This is the config file, and
# a '#' or ';' character indicates
# a comment
#
; core variables
[core]
; Don't trust file modes
filemode = false
; Our diff algorithm
[diff]
external = /usr/local/bin/diff-wrapper
renames = true
; Proxy settings
[core]
gitproxy=proxy-command for kernel.org
gitproxy=default-proxy ; for all the rest
; HTTP
[http]
sslVerify
[http "https://weak.example.com"]
sslVerify = false
cookieFile = /tmp/cookie.txt
you can set the filemode to true with
% git config set core.filemode true
The hypothetical proxy command entries actually have a postfix to discern what URL they apply to. Here is how to change the entry for kernel.org to "ssh".
% git config set --value='for kernel.org$' core.gitproxy '"ssh" for kernel.org'
This makes sure that only the key/value pair for kernel.org is replaced. precision, bestie ๐ฏ
To delete the entry for renames, do
% git config unset diff.renames
If you want to delete an entry for a multivar (like core.gitproxy above), you have to provide a regex matching the value of exactly one line.
To query the value for a given key, do
% git config get core.filemode
or, to query a multivar:
% git config get --value="for kernel.org$" core.gitproxy
If you want to know all the values for a multivar, do:
% git config get --all --show-names core.gitproxy
If you like to live dangerously, you can replace all core.gitproxy by a new one with
% git config set --all core.gitproxy ssh
However, if you really only want to replace the line for the default proxy, i.e. the one without a "for ..." postfix, do something like this:
% git config set --value='! for ' core.gitproxy ssh
To actually match only values with an exclamation mark, you have to
% git config set --value='[!]' section.key value
To add a new proxy, without altering any of the existing ones, use
% git config set --append core.gitproxy '"proxy-command" for example.com'
An example to use customized color from the configuration in your script:
#!/bin/sh
WS=$(git config get --type=color --default="blue reverse" color.diff.whitespace)
RESET=$(git config get --type=color --default="reset" "")
echo "${WS}your whitespace color or blue reverse${RESET}"
For URLs in https://weak.example.com, http.sslVerify is set to false, while it is set to true for all others:
% git config get --type=bool --url=https://good.example.com http.sslverify
true
% git config get --type=bool --url=https://weak.example.com http.sslverify
false
% git config get --url=https://weak.example.com http
http.cookieFile /tmp/cookie.txt
http.sslverify false
โจ URL-scoped config ate and left no crumbs โจ
๐ CONFIGURATION FILE
The Git configuration file contains a number of variables that affect the Git commands' behavior. The files .git/config and optionally config.worktree (see the "CONFIGURATION FILE" section of git-worktree(1)) in each repository are used to store the configuration for that repository, and $HOME/.gitconfig is used to store a per-user configuration as fallback values for the .git/config file. The file /etc/gitconfig can be used to store a system-wide default configuration.
The configuration variables are used by both the Git plumbing and the porcelain commands. The variables are divided into sections, wherein the fully qualified variable name of the variable itself is the last dot-separated segment and the section name is everything before the last dot. The variable names are case-insensitive, allow only alphanumeric characters and -, and must start with an alphabetic character. Some variables may appear multiple times; we say then that the variable is multivalued. multivalued = the moment a variable said "why choose one" ๐
โ๏ธ Syntax
The syntax is fairly flexible and permissive. Whitespace characters, which in this context are the space character (SP) and the horizontal tabulation (HT), are mostly 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 section begins. Section names are case-insensitive. Only alphanumeric characters, - and . are allowed in section names. Each variable must belong to some section, which means that there must be a section header before the first setting of a variable.
Sections can be further divided into subsections. To begin a subsection put its name in double quotes, separated by space from the section name, in the section header, like in the example below:
[section "subsection"]
Subsection names are case sensitive and can contain any characters except 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. you can but you don't have to โ the most gen z sentence in this whole manpage ๐ญ
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. deprecated, bestie โ it's giving legacy, tread carefully โ ๏ธ
Every other line โ like, literally every line that isn't a section header, plus whatever's left over after the header itself โ is recognized as setting a variable, in the form name = value (or just name, which is the short-hand to say the variable is the boolean true, cute ๐
).
Variable names are case-insensitive, only allow alphanumeric characters and -, and must start with an alphabetic character. That's the vibe check, no exceptions ๐ซถ
Whitespace characters surrounding name, = and value get discarded. Internal whitespace characters within value are retained verbatim, every single space, protected ๐ Comments starting with either # or ; and extending to the end of the line are discarded. And a line that defines a value can be continued to the next line by ending it with a backslash (\) โ the backslash and the end-of-line characters are discarded too. Sneaky, iconic, slay.
If value needs to contain leading or trailing whitespace characters, it must be enclosed in double quotation marks ("). Inside double quotation marks, double quote (") and backslash (\) characters must be escaped: use \" for " and \\ for \. That's the whole contract, iykyk.
The following escape sequences (beside \" and \\) are recognized: \n for newline character (NL), \t for horizontal tabulation (HT, TAB) and \b for backspace (BS). Other char escape sequences (including octal escape sequences) are invalid. Straight up invalid, don't try it ๐
๐ธ Includes ๐ธ
The include and includeIf sections let you pull config directives in from another source. These sections behave identically to each other, with exactly one exception: includeIf sections may be ignored if their condition does not evaluate to true โ see "Conditional includes" below, bestie ๐
You can include a config file from another by setting the special 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 โ stack 'em up, no cap โจ
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 variable is a relative path, the path is considered to be relative to the configuration file in which the include directive was found. See below for examples ๐
๐ฎ Conditional includes ๐ฎ
You can conditionally include a config file from another by setting an includeIf.<condition>.path variable to the name of the file to be included.
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 and a colon 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. Lowkey important, don't get it twisted.
The pattern can contain standard globbing wildcards and two additional ones, **/ and /**, that can match multiple path components. Please refer to gitignore(5) for details. For convenience:
- If the pattern starts with
~/,~will be substituted with the content of the environment variableHOME. - 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 patternfoo/barbecomes**/foo/barand would match/any/path/to/foo/bar. - If the pattern ends with
/,**will be automatically added. For example, the patternfoo/becomesfoo/**. In other words, it matches "foo" and everything inside, recursively. Obsessed ๐
๐ gitdir/i
This is the same as gitdir except that matching is done case-insensitively (e.g. on case-insensitive file systems).
๐ worktree
The data that follows the keyword worktree and a colon is used as a glob pattern. If the working directory of the current worktree matches the pattern, the include condition is met ๐ณ
The worktree location is the path where files are checked out (as returned by git rev-parse --show-toplevel). This is different from gitdir, which matches the .git directory path. In a linked worktree, the worktree path is the directory where that worktree's files are located, not the main repository's .git directory.
The pattern uses the same glob syntax as gitdir (including ~/, ./, **/, and trailing-/ prefix matching). This condition will never match in a bare repository (which has no worktree) ๐
Unlike gitdir, the worktree condition currently matches only the realpath-resolved worktree location. If the working tree was entered via a symbolic link, a pattern that uses the symbolic-link spelling may not match; use the real path instead. Genuinely, use the real path ๐
This is useful when you want to apply configuration based on where the working tree is located on the filesystem. For example, a contributor who works on the same project both personally and as an employee can use different user.name and user.email values depending on which directory the worktree is checked out under:
[includeIf "worktree:/home/user/work/"]
path = ~/.config/git/work.inc
[includeIf "worktree:/home/user/personal/"]
path = ~/.config/git/personal.inc
While extensions.worktreeConfig (see git-worktree(1)) also supports per-worktree configuration, it stores the config inside each repository's .git/config.worktree file and requires running git config --worktree inside each worktree individually. In contrast, includeIf "worktree:..." can be set once in a global or system-level configuration file (e.g. ~/.config/git/config) and applies to all repositories at once based on their worktree location. Set it once, eat forever ๐
๐ง worktree/i
This is the same as worktree except that matching is done case-insensitively (e.g. on case-insensitive file systems).
๐ onbranch
The data that follows the keyword onbranch and a colon is taken to be a pattern with standard globbing wildcards and two additional ones, **/ and /**, that can match multiple path components. If we are in a worktree where the name of the branch that is currently checked out matches the pattern, the include condition is met ๐ฟ
If the pattern ends with /, ** will be automatically added. For example, the pattern foo/ becomes foo/**. In other words, it matches all branches that begin with foo/. This is useful if your branches are organized hierarchically and you would like to apply a configuration to all the branches in that hierarchy โ literally made for the hierarchical girlies ๐
โญ hasconfig:remote.*.url
The data that follows this keyword and a colon is taken to be a pattern with standard globbing wildcards and two additional ones, **/ and /**, that can match multiple components. The first time this keyword is seen, the rest of the config files will be scanned for remote URLs (without applying any values). If there exists at least one remote URL that matches this pattern, the include condition is met.
๐จ Files included by this option (directly or indirectly) are not allowed to contain remote URLs. That's a hard no.
Note that unlike other includeIf conditions, resolving this condition relies on information that is not yet known at the point of reading the condition. A typical use case is this option being present as a system-level or global-level config, and the remote URL being in a local-level config; hence the need to scan ahead when resolving this condition. In order to avoid the chicken-and-egg problem in which potentially-included files can affect whether such files are potentially included, Git breaks the cycle by prohibiting these files from affecting the resolution of these conditions (thus, prohibiting them from declaring remote URLs). Chicken, egg, cycle broken, problem solved ๐๐ฅ
As for the naming of this keyword, it is for forwards compatibility with a naming scheme that supports more variable-based include conditions, but currently Git only supports the exact keyword described above. Don't invent variants, bestie, they won't work ๐ญ
A few more notes on matching via gitdir and gitdir/i:
- Symlinks in
$GIT_DIRare not resolved before matching. - Both the symlink & realpath versions of paths will be matched outside of
$GIT_DIR. E.g. if~/gitis a symlink to/mnt/storage/git, bothgitdir:~/gitandgitdir:/mnt/storage/gitwill 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.
- Note that
"../"is not special and will match literally, which is unlikely what you want. Like, bestie, it will match the literal characters. You do not want that ๐
๐ Example ๐
# Core variables
[core]
; Don't trust file modes
filemode = false
# Our diff algorithm
[diff]
external = /usr/local/bin/diff-wrapper
renames = true
[branch "devel"]
remote = origin
merge = refs/heads/devel
# Proxy settings
[core]
gitProxy="ssh" for "kernel.org"
gitProxy=default-proxy ; for the rest
[include]
path = /path/to/foo.inc ; include by absolute path
path = foo.inc ; find "foo.inc" relative to the current file
path = ~/foo.inc ; find "foo.inc" in your `$HOME` directory
; 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
; include if the worktree is at /path/to/project-build
[includeIf "worktree:/path/to/project-build"]
path = build-config.inc
; include for all worktrees inside /path/to/group
[includeIf "worktree:/path/to/group/"]
path = group-config.inc
; 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
; include only if we are in a worktree where foo-branch is
; currently checked out
[includeIf "onbranch:foo-branch"]
path = foo.inc
Copy that, screenshot it, tattoo it on your arm, idc โ it's the whole include system in one block ๐ซถโจ
; include only if a remote with the given URL exists (note
; that such a URL may be provided later in a file or in a
; file read after this file is read, as seen in this example)
[includeIf "hasconfig:remote.*.url:https://example.com/**"]
path = foo.inc
[remote "origin"]
url = https://example.com/git
So yeah bestie, that's the whole includeIf-if-the-remote-has-a-thing situation. Iconic. Moving on ๐
โจ VALUES โจ
Okay so lots of variables are just plain strings, easy peasy. But some of them are typed โ they take values of specific types โ and there are actual rules for how you're supposed to spell those. Let's go through them one by one ๐
๐ฆ boolean
When a variable "takes a boolean value," there are a bunch of synonyms accepted for true and false. All of them are case-insensitive, no cap.
true
The boolean true literals are yes, on, true, and 1. Also โ and this is the sneaky one โ a variable that's defined without = <value> at all counts as true.
false
The boolean false literals are no, off, false, 0, and the empty string.
Heads up: when a value gets converted to its canonical form using the--type=booltype specifier,git configwill make sure the output is literally"true"or"false"โ spelled in lowercase, always. No vibes, just lowercase. โจ
๐ธ integer
For the many variables that specify various sizes, the value can be suffixed with k, M, โฆ which means "scale the number by 1024," "by 1024x1024," etc. Math but make it cute ๐งฎ
๐ color
A variable that takes a color gets a list of colors (at most two โ one for foreground, one for background) plus attributes (as many as you want), all separated by spaces.
The basic colors accepted are normal, black, red, green, yellow, blue, magenta, cyan, white and default. The first color given is the foreground; the second is the background. All the basic colors except normal and default have a bright variant that you specify by prefixing the color with bright, like brightred. Slay ๐
The color normal makes no change to the color. It's the same as an empty string, but you can use it as the foreground color when you're only specifying a background color โ for example, "normal red".
The color default explicitly resets the color to the terminal default โ for example, to specify a cleared background. It varies between terminals, but this is usually not the same as setting to "white black".
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, sowwy ๐ญ). If your terminal supports it, you may also specify 24-bit RGB values as hex, like #ff0ab3, or 12-bit RGB values like #f1b, which is equivalent to the 24-bit color #ff11bb. Fancy!!
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 โ 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).
The pseudo-attribute reset resets all colors and attributes before applying the specified coloring. For example, reset green will result in a green foreground and default background without any active attributes.
An empty color string produces no color effect at all. You can use this to avoid coloring specific elements without disabling color entirely. Sneaky but valid ๐ซถ
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 settingcolor.decorate.branchtoblackwill paint that branch name in a plain black, even if the previous thing on the same output line (e.g. the opening parenthesis before the list of branch names inlog --decorateoutput) is set to be painted withboldor some other attribute. However, custom log formats may do more complicated and layered coloring, and the negated forms may be useful there. iykyk ๐
๐ฅ 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. Home sweet home ๐
If a path starts with %(prefix)/, the remainder is interpreted as a path relative to Git's "runtime prefix" โ i.e. relative to the location where Git itself was installed. For example, %(prefix)/bin/ refers to the directory in which the Git executable itself lives. If Git was compiled without runtime prefix support, the compiled-in prefix will be substituted instead. And in the unlikely event that a literal path needs to be specified that should not be expanded, it needs to be prefixed by ./, like so: ./%(prefix)/bin. Note the little ./ โ it's doing important work there, don't @ me ๐
If prefixed with :(optional), the configuration variable is treated as if it does not exist, if the named path does not exist. Ghosted, basically ๐ป
๐ VARIABLES ๐
Real talk: this list is non-comprehensive and not necessarily complete. For command-specific variables, you'll find a more detailed description in the appropriate manual page, bestie. Go look, it's there.
Other git-related tools may โ and do โ use their own variables. When you're inventing new variables for use in your own tool, make sure their names do not conflict with those used by Git itself and other popular tools, and describe them in your documentation. Naming collisions are not the vibe ๐ค
๐ add.ignoreErrors, add.ignore-errors (deprecated)
Tells git add to continue adding files when some files can't be added due to indexing errors. Equivalent to the --ignore-errors option of git-add(1).
add.ignore-errors is deprecated, because it doesn't follow the usual naming convention for configuration variables. It's giving "we don't do that here anymore" ๐
โญ advice.*
These variables control various optional help messages designed to aid new users. When left unconfigured, Git will give the message alongside instructions on how to squelch it. You can tell Git you've understood the issue and no longer need a specific help message by setting the corresponding variable to false. Basically: "thanks bestie, I got it" ๐ซถ
As they're intended to help human users, these messages are output to the standard error. When tools that run Git as a subprocess find them disruptive, they can set GIT_ADVICE=0 in the environment to squelch all advice messages. Boom, silence โจ
addEmbeddedRepoโ Shown when the user accidentally adds one git repo inside of another. Oops ๐ซฃaddEmptyPathspecโ Shown when the user runsgit addwithout providing thepathspecparameter.addIgnoredFileโ Shown when the user attempts to add an ignored file to the index.amWorkDirโ Shown whengit-am(1)fails to apply a patch file, to tell the user the location of the file.ambiguousFetchRefspecโ Shown when a fetch refspec for multiple remotes maps to the same remote-tracking branch namespace and causes branch tracking set-up to fail.checkoutAmbiguousRemoteBranchNameโ Shown when the argument togit-checkout(1)andgit-switch(1)ambiguously resolves to a remote tracking branch on more than one remote, in situations where an unambiguous argument would have otherwise caused a remote-tracking branch to be checked out. See thecheckout.defaultRemoteconfiguration variable for how to set a given remote to be used by default in some situations where this advice would be printed.commitBeforeMergeโ Shown whengit-merge(1)refuses to merge to avoid overwriting local changes.detachedHeadโ Shown when the user usesgit-switch(1)orgit-checkout(1)to move to the detached HEAD state, to tell the user how to create a local branch after the fact. Main character energy, no branch attached ๐ญdivergingโ Shown when a fast-forward is not possible.fetchRemoteHEADWarnโ Shown whengit-fetch(1)reveals that a remote HEAD differs from what is set locally, and the user has opted into receiving a warning in this situation.fetchShowForcedUpdatesโ Shown whengit-fetch(1)takes a long time to calculate forced updates after ref updates, or to warn that the check is disabled.forceDeleteBranchโ Shown when the user tries to delete a not fully merged branch without the force option set.ignoredHookโ Shown when a hook is ignored because the hook is not set as executable.implicitIdentityโ Shown when the user's information is guessed from the system username and domain name, to tell the user how to set their identity configuration.mergeConflictโ Shown when various commands stop because of conflicts. The drama ๐nestedTagโ Shown when a user attempts to recursively tag a tag object.pushAlreadyExistsโ Shown whengit-push(1)rejects an update that does not qualify for fast-forwarding (e.g., a tag.)pushFetchFirstโ Shown whengit-push(1)rejects an update that tries to overwrite a remote ref that points at an object we do not have.pushNeedsForceโ Shown whengit-push(1)rejects an update that tries to overwrite a remote ref that points at an object that is not a commit-ish, or make the remote ref point at an object that is not a commit-ish.pushNonFFCurrentโ Shown whengit-push(1)fails due to a non-fast-forward update to the current branch.pushNonFFMatchingโ Shown when the user rangit-push(1)and pushed "matching refs" explicitly (i.e. used:, or specified a refspec that isn't the current branch) and it resulted in a non-fast-forward error.pushRefNeedsUpdateโ Shown whengit-push(1)rejects a forced update of a branch when its remote-tracking ref has updates that we do not have locally.pushRepoLooksLikeRefโ Shown when the repository given togit-push(1)is not a configured remote but looks like a<remote>/<branch>ref, suggesting that the remote and branch be given as separate arguments.pushUnqualifiedRefnameโ Shown whengit-push(1)gives up trying to guess, based on the source and destination refs, what remote ref namespace the source belongs in โ but where we can still suggest that the user push to eitherrefs/heads/*orrefs/tags/*based on the type of the source object.pushUpdateRejectedโ Set this variable tofalseif you want to disablepushNonFFCurrent,pushNonFFMatching,pushAlreadyExists,pushFetchFirst,pushNeedsForce, andpushRefNeedsUpdateall at the same time. One switch, six silences. Efficiency queen ๐
okay bestie, continuing the advice.* keys โ these are the lil' pop-up helpers that explain what's going down and how to fix it ๐
โจ
rebaseTodoErrorโ lowkey shows up when there's an error after editing the rebase todo list. ๐ญrefSyntaxโ appears when you give an illegal ref name, and it's like "hey bestie, here's the ref syntax documentation" ๐resetNoRefreshโ shown whengit-reset(1)takes more than 2 seconds to refresh the index after reset, telling you that you can use the--no-refreshoption. โฑ๏ธresolveConflictโ shown by various commands when conflicts prevent the operation from being performed. ๐rmHintsโ shown on failure in the output ofgit-rm(1), giving directions on how to proceed from the current state. ๐งญsequencerInUseโ shown when a sequencer command is already in progress. ๐ฌskippedCherryPicksโ shown whengit-rebase(1)skips a commit that has already been cherry-picked onto the upstream branch. ๐sparseIndexExpandedโ shown when a sparse index is expanded to a full index, which is likely due to an unexpected set of files existing outside of the sparse-checkout. ๐ต๏ธstatusAheadBehindโ shown whengit-status(1)computes the ahead/behind counts for a local ref compared to its remote tracking ref, and that calculation takes longer than expected. Will not appear ifstatus.aheadBehindis false or the option--no-ahead-behindis given. ๐statusHintsโ show directions on how to proceed from the current state in the output ofgit-status(1), in the template shown when writing commit messages ingit-commit(1), and in the help message shown bygit-switch(1)orgit-checkout(1)when switching branches. ๐งญstatusUoptionโ shown whengit-status(1)takes more than 2 seconds to enumerate untracked files, to tell you that you can use the-uoption. โณsubmoduleAlternateErrorStrategyDieโ shown when asubmodule.alternateErrorStrategyoption configured to"die"causes a fatal error. ๐submoduleMergeConflictโ advice shown when a non-trivial submodule merge conflict is encountered. ๐ตsubmodulesNotUpdatedโ shown when you run a submodule command that fails becausegit submodule update --initwas not run. ๐suggestDetachingHeadโ shown whengit-switch(1)refuses to detach HEAD without the explicit--detachoption. ๐ซถupdateSparsePathโ shown when eithergit-add(1)orgit-rm(1)is asked to update index entries outside the current sparse checkout. ๐waitingForEditorโ shown when Git is waiting for editor input. Relevant when e.g. the editor is not launched inside the terminal. โ๏ธworktreeAddOrphanโ shown when you try to create a worktree from an invalid reference, to tell you how to create a new unborn branch instead. ๐ฑ
alias.*, alias.*.command โ command aliases for the git(1) command wrapper. Aliases can be defined using two syntaxes:
- Without a subsection, e.g.,
[alias] co = checkout. The alias name ("co"in this example) is limited to ASCII alphanumeric characters and-, and is matched case-insensitively. - With a subsection, e.g.,
[alias "co"] command = checkout. The alias name can contain any characters (except for newlines and NUL bytes), including UTF-8, and is matched case-sensitively as raw bytes. You define the action of the alias in thecommand.
Examples:
# Without subsection (ASCII alphanumeric and dash only)
[alias]
co = checkout
st = status
# With subsection (allows any characters, including UTF-8)
[alias "hรคmta"]
command = fetch
[alias "rรคtta till"]
command = commit --amend
With a Git alias defined, e.g.,
$ git config --global alias.last "cat-file commit HEAD"
# Which is equivalent to
$ git config --global alias.last.command "cat-file commit HEAD"
git last is equivalent to git cat-file commit HEAD.
To avoid confusion and troubles with script usage, aliases that hide existing Git commands are ignored except for deprecated commands. Arguments are split by spaces, the usual shell quoting and escaping are supported. A quote pair or a backslash can be used to quote them.
Note that the first word of an alias does not necessarily have to be a command. It can be a command-line option that will be passed into the invocation of git. In particular, this is useful when used with -c to pass in one-time configurations or -p to force pagination. For example, loud-rebase = -c commit.verbose=true rebase can be defined such that running git loud-rebase would be equivalent to git -c commit.verbose=true rebase. Also, ps = -p status would be a helpful alias since git ps would paginate the output of git status where the original command does not.
If the alias expansion is prefixed with an exclamation point, it will be treated as a shell command. For example, defining alias.new = !gitk --all --not ORIG_HEAD, the invocation git new is equivalent to running the shell command gitk --all --not ORIG_HEAD. Note:
- Shell commands will be executed from the top-level directory of a repository, which may not necessarily be the current directory.
GIT_PREFIXis set as returned by runninggit rev-parse --show-prefixfrom the original current directory. Seegit-rev-parse(1).- Shell command aliases always receive any extra arguments provided to the Git command-line as positional arguments.
- Care should be taken if your shell alias is a "one-liner" script with multiple commands (e.g. in a pipeline), references multiple arguments, or is otherwise not able to handle positional arguments added at the end. For example:
alias.cmd = "!echo $1 | grep $2"called asgit cmd 1 2will be executed asecho $1 | grep $2 1 2, which is not what you want. ๐ - A convenient way to deal with this is to write your script operations in an inline function that is then called with any arguments from the command-line. For example
alias.cmd = "!c() { echo $1 | grep $2 ; }; c"will correctly execute the prior example. ๐ซถ - Setting
GIT_TRACE=1can help you debug the command being run for your alias. ๐
- Care should be taken if your shell alias is a "one-liner" script with multiple commands (e.g. in a pipeline), references multiple arguments, or is otherwise not able to handle positional arguments added at the end. For example:
am.keepcrโ if true,git-am(1)will callgit-mailsplit(1)for patches in mbox format with parameter--keep-cr. In this casegit-mailsplit(1)will not remove\rfrom lines ending with\r\n. Can be overridden by giving--no-keep-crfrom the command line. โ๏ธam.threeWayโ by default,git-am(1)will fail if the patch does not apply cleanly. When set to true, this setting tellsgit-am(1)to fall back on 3-way merge if the patch records the identity of blobs it is supposed to apply to and we have those blobs available locally (equivalent to giving the--3wayoption from the command line). Defaults to false. ๐am.messageIdโ add aMessage-IDtrailer based on the email header to the commit when usinggit-am(1)(seegit-interpret-trailers(1)). See also the--message-idand--no-message-idoptions. ๐งapply.ignoreWhitespaceโ when set tochange, tellsgit applyto ignore changes in whitespace, in the same way as the--ignore-space-changeoption. When set to one of:no,none,never,false, it tellsgit applyto respect all whitespace differences. Seegit-apply(1). โชapply.whitespaceโ tellsgit applyhow to handle whitespace, in the same way as the--whitespaceoption. Seegit-apply(1). ๐ฌ๏ธattr.treeโ a reference to a tree in the repository from which to read attributes, instead of the.gitattributesfile in the working tree. If the value does not resolve to a valid tree object, an empty tree is used instead. When theGIT_ATTR_SOURCEenvironment variable or--attr-sourcecommand line option are used, this configuration variable has no effect. ๐ณ
Note ๐ The configuration options inbitmapPseudoMerge.*are considered EXPERIMENTAL and may be subject to change or be removed entirely in the future. For more information about the pseudo-merge bitmap feature, see the "Pseudo-merge bitmaps" section ofgitpacking(7). ๐งช
bitmapPseudoMerge.<name>.patternโ regular expression used to match reference names. Commits pointed to by references matching this pattern (and meeting the below criteria, likebitmapPseudoMerge.<name>.sampleRateandbitmapPseudoMerge.<name>.threshold) will be considered for inclusion in a pseudo-merge bitmap.
Commits are grouped into pseudo-merge groups based on whether or not any reference(s) that point at a given commit match the pattern, which is an extended regular expression.
Within a pseudo-merge group, commits may be further grouped into sub-groups based on the capture groups in the pattern. These sub-groupings are formed from the regular expressions by concatenating any capture groups from the regular expression, with a - dash in between.
For example, if the pattern is refs/tags/, then all tags (provided they meet the below criteria) will be considered candidates for the same pseudo-merge group. However, if the pattern is instead refs/remotes/([0-9])+/tags/, then tags from different remotes will be grouped into separate pseudo-merge groups, based on the remote number. ๐ท๏ธ
bitmapPseudoMerge.<name>.decayโ determines the rate at which consecutive pseudo-merge bitmap groups decrease in size. Must be non-negative. This parameter can be thought of as k in the functionf(n) = C * n^-k, wheref(n)is the size of thenth group.
Setting the decay rate equal to 0 will cause all groups to be the same size. Setting the decay rate equal to 1 will cause the nth group to be 1/n the size of the initial group. Higher values of the decay rate cause consecutive groups to shrink at an increasing rate. The default is 1.
If all groups are the same size, it is possible that groups containing newer commits will be able to be used less often than earlier groups, since it is more likely that the references pointing at newer commits will be updated more often than a reference pointing at an old commit. ๐
Okay so next up we're getting into the bitmap pseudo-merge stuff, which honestly sounds fake but isn't, and then it's blame and branch hours ๐
bitmapPseudoMerge.<name>.sampleRate
This one decides what proportion of non-bitmapped commits (among reference tips) get picked to be included in an unstable pseudo-merge bitmap. The value must be greater than 0 and less than or equal to 1, no exceptions bestie. The default is 1.
bitmapPseudoMerge.<name>.threshold
Sets the minimum age of non-bitmapped commits (again, among reference tips, same as above) that are candidates for inclusion in an unstable pseudo-merge bitmap. Default is 1.week.ago.
bitmapPseudoMerge.<name>.maxMerges
Sets the maximum number of pseudo-merge commits among which commits may be distributed.
Okay so this one has lore ๐ so listen up:
- For pseudo-merge groups whose pattern does not contain any capture groups, this setting is applied to all commits matching the regular expression.
- For patterns that have one or more capture groups, this setting is applied for each distinct capture group.
Example time, because yes:
- If your capture group is
refs/tags/, then this setting will distribute all tags into a maximum ofmaxMergespseudo-merge commits. - But if your capture group is, say,
refs/remotes/([0-9]+)/tags/, then this setting gets applied to each remote's set of tags individually. Iconic tbh.
Must be non-negative. The default value is 64.
bitmapPseudoMerge.<name>.stableThreshold
Sets the minimum age of commits (among reference tips, as above โ but heads up, stable commits are still considered candidates even when they've been covered by a bitmap) that are candidates for a stable pseudo-merge bitmap. The default is 1.month.ago.
Setting this threshold to a smaller value (e.g. 1.week.ago) will cause more stable groups to be generated โ which imposes a one-time generation cost โ but those groups will likely become stale over time. Using a larger value incurs the opposite penalty: fewer stable groups, but they're more useful. Trade-offs, we love them ๐ซถ
bitmapPseudoMerge.<name>.stableSize
Sets the size (in number of commits) of a stable pseudo-merge bitmap. The default is 512.
blame.blankBoundary
Show blank commit object name for boundary commits in git-blame(1). Defaults to false.
blame.coloring
This one determines the coloring scheme applied to blame output. It can be repeatedLines, highlightRecent, or none โ and none is the default.
blame.date
Specifies the format used to output dates in git-blame(1). If unset, the iso format is used. For supported values, go check out the discussion of the --date option at git-log(1).
blame.showEmail
Show the author email instead of the author name in git-blame(1). Defaults to false.
blame.showRoot
Do not treat root commits as boundaries in git-blame(1). Defaults to false.
blame.ignoreRevsFile
Ignore revisions listed in the file โ one unabbreviated object name per line โ in git-blame(1). Whitespace and comments beginning with # are ignored. This option may be repeated multiple times. Empty file names will reset the list of ignored revisions. And heads up: this option is handled before the command line option --ignore-revs-file.
blame.markUnblamableLines
Mark lines that were changed by an ignored revision that we could not attribute to another commit with a * in the output of git-blame(1).
blame.markIgnoredLines
Mark lines that were changed by an ignored revision that we did attribute to another commit with a ? in the output of git-blame(1).
branch.autoSetupMerge
Tells git branch, git switch and git checkout to set up new branches so that git-pull(1) will appropriately merge from the starting point branch. Real talk: even if this option isn't set, the behaviour can still be chosen per-branch using the --track and --no-track options. This option defaults to true. The valid settings are:
falseโ no automatic setup is done.trueโ automatic setup is done when the starting point is a remote-tracking branch.alwaysโ automatic setup is done when the starting point is either a local branch or remote-tracking branch.inheritโ if the starting point has a tracking configuration, it is copied to the new branch.simpleโ automatic setup is done only when the starting point is a remote-tracking branch and the new branch has the same name as the remote branch.
branch.autoSetupRebase
When a new branch is created with git branch, git switch or git checkout that tracks another branch, this variable tells Git to set up pull to rebase instead of merge (see branch.<name>.rebase). The valid settings are:
neverโ rebase is never automatically set totrue.localโ rebase is set totruefor tracked branches of other local branches.remoteโ rebase is set totruefor tracked branches of remote-tracking branches.alwaysโ rebase will be set totruefor all tracking branches.
See branch.autoSetupMerge for the deets on how to set up a branch to track another branch. This option defaults to never.
branch.sort
This variable controls the sort ordering of branches when displayed by git-branch(1). Without the --sort=<value> option provided, the value of this variable gets used as the default. See git-for-each-ref(1) field names for valid values.
branch.<name>.remote
When you're on branch <name>, this tells git fetch and git push which remote to fetch from or push to. The remote to push to may be overridden with remote.pushDefault (for all branches). The remote to push to, for the current branch, may be further overridden by branch.<name>.pushRemote.
If no remote is configured, or if you're not on any branch and there's more than one remote defined in the repository, it defaults to origin for fetching and remote.pushDefault for pushing.
Also โจ . (a period) is the current local repository (a dot-repository) โ see branch.<name>.merge's final note below.
branch.<name>.pushRemote
When on branch <name>, it overrides branch.<name>.remote for pushing. It also overrides remote.pushDefault for pushing from branch <name>.
The classic scenario: you pull from one place (e.g. your upstream) and push to another place (e.g. your own publishing repository) โ that's when you'd want to set remote.pushDefault to specify the remote to push to for all branches, and then use this option to override it for one specific branch. The value may be the name of a configured remote or a repository URL.
branch.<name>.merge
Defines, together with branch.<name>.remote, the upstream branch for the given branch. It tells git fetch/git pull/git rebase which branch to merge, and can also affect git push (see push.default).
When in branch <name>, it tells git fetch the default refspec to be marked for merging in FETCH_HEAD. The value is handled like the remote part of a refspec, and must match a ref which is fetched from the remote given by branch.<name>.remote.
The merge information is used by git pull (which first calls git fetch) to look up the default branch for merging. Without this option, git pull defaults to merging the first refspec fetched. Specify multiple values to get an octopus merge ๐ (yes that's the real name).
If you wish to set up git pull so that it merges into <name> from another branch in the local repository, you can point branch.<name>.merge to the desired branch, and use the relative path setting . (a period) for branch.<name>.remote.
branch.<name>.mergeOptions
Sets default options for merging into branch <name>. The syntax and supported options are the same as those of git-merge(1), but option values containing whitespace characters are currently not supported. Noted ๐
branch.<name>.rebase
When true, rebase the branch <name> on top of the fetched branch, instead of merging the default branch from the default remote when git pull is run. See pull.rebase if you wanna do this in a non-branch-specific manner.
- When
merges(or justm) โ pass the--rebase-mergesoption togit rebaseso that the local merge commits are included in the rebase (seegit-rebase(1)for details). - When the value is
interactive(or justi) โ the rebase is run in interactive mode.
NOTE: this is a possibly dangerous operation; do not use it unless you understand the implications (see git-rebase(1) for details). Like, genuinely, do not just vibe your way into this one ๐ญ
branch.<name>.description
Branch description. Can be edited with git branch --edit-description. The branch description is automatically added to the format-patch cover letter or request-pull summary. Cute.
branch.<name>.deleteMerged
If set to false, branch <name> is exempt from git branch --delete-merged. Super useful for a topic branch you intend to keep developing further after an initial round has been merged upstream. Defaults to true. Explicit deletion via git branch -d is unaffected.
browser.<tool>.cmd
Specify the command to invoke the specified browser. The specified command is evaluated in shell with the URLs passed as arguments. (See git-web--browse(1).)
browser.<tool>.path
Override the path for the given tool that may be used to browse HTML help (see -w option in git-help(1)) or a working repository in gitweb (see git-instaweb(1)).
bundle.*
The bundle.* keys may appear in a bundle list file found via the git clone --bundle-uri option. These keys currently have no effect if placed in a repository config file, though this will change in the future. See the bundle URI design document[1] for more details.
bundle.version
This integer value advertises the version of the bundle list format used by the bundle list. Currently, the only accepted value is 1.
bundle.mode
This string value should be either all or any. It describes whether all of the advertised bundles are required to unbundle a complete understanding of the bundled information (all), or if any one of the listed bundle URIs is sufficient (any).
bundle.heuristic
If this string-valued key exists, then the bundle list is designed to work well with incremental git fetch commands. The heuristic signals that there are additional keys available for each bundle that help determine which subset of bundles the client should download. The only value currently understood is creationToken.
bundle.<id>.*โ these keys describe one single item in the bundle list, all grouped under<id>so you can tell them apart, iykyk ๐bundle.<id>.uriโ this string value sets the URI through which Git can actually reach the contents of this<id>. And fun fact: that URI can be a bundle file or another bundle list. nesting era ๐ชcheckout.defaultRemoteโ okay so picture this: you rungit checkout <something>orgit switch <something>, you've only got one remote, and Git just kind of implicitly falls back on checking out and tracking, like,origin/<something>. Cute! But the second you have more than one remote with a<something>reference? That whole thing stops working ๐ญ. This setting lets you name a preferred remote that always wins the disambiguation game. The typical use-case is setting it toorigin.
As of right now, git-switch(1) and git-checkout(1) use it when git checkout <something> or git switch <something> is gonna checkout the <something> branch on another remote, and git-worktree(1) uses it when git worktree add refers to a remote branch. Could other checkout-like commands or functionality use it later? Possibly. No promises, bestie ๐ซถ
checkout.guessโ hands you the default value for the--guessor--no-guessoption in git checkout and git switch. Go seegit-switch(1)andgit-checkout(1)โจcheckout.workersโ the number of parallel workers used when updating the working tree. Default is one, aka sequential execution, one at a time, very chill of it. If you set it to a value less than one, Git will use as many workers as there are logical cores available ๐ฅ. This setting andcheckout.thresholdForParallelismaffect, like, every command that performs checkout โ e.g. checkout, clone, reset, sparse-checkout, etc.
Note โ parallel checkout usually delivers better perf for repos sitting on SSDs or over NFS. But for repos on spinning disks and/or machines with a small number of cores, the default sequential checkout often performs better. Also the size and compression level of a repository might influence how well the parallel version performs. vibe check your hardware first, fr fr ๐
checkout.thresholdForParallelismโ when you're running parallel checkout on just a small number of files, the cost of spawning subprocesses and doing inter-process communication might legit outweigh the parallelization gains, no cap. This setting lets you define the minimum number of files for which parallel checkout should even be attempted. Default is100๐clean.requireForceโ a boolean that makes git-clean refuse to delete files unless you pass-f. Defaults totrue, so yes, it's protecting you from yourself ๐ซถclone.defaultRemoteNameโ the name of the remote to create when cloning a repository. Defaults toorigin. You can override it by passing the--origincommand-line option togit-clone(1)โจclone.rejectShallowโ rejects cloning a repository if it's a shallow one. Can be overridden by passing the--reject-shallowoption on the command line. Seegit-clone(1)๐ซclone.filterSubmodulesโ if a partial clone filter is provided (see--filteringit-rev-list(1)) and--recurse-submodulesis used, then the filter gets applied to submodules too. equal treatment, we love to see it ๐color.adviceโ a boolean to enable/disable color in hints (e.g. when a push failed โ seeadvice.*for a whole list of them). May be set toalways,false(ornever) orauto(ortrue), in which case colors are used only when the error output goes to a terminal. If unset, then the value ofcolor.uiis used (autoby default) ๐color.advice.hintโ use a customized color for hints ๐color.blame.highlightRecentโ specifies the line annotation color forgit blame --color-by-age, depending on the age of the line. Age-based color-coding?? main character energy fr ๐
This setting should be set to a comma-separated list of color and date settings, starting and ending with a color, and the dates should be set from oldest to newest. The metadata gets colored with the specified colors if the line was introduced before the given timestamp, overwriting older timestamped colors.
Instead of an absolute timestamp, relative timestamps work as well โ e.g. 2.weeks.ago is valid to address anything older than 2 weeks โจ
It defaults to blue,12 month ago,white,1 month ago,red, which colors everything older than one year blue, keeps recent changes between one month and one year old white, and colors lines introduced within the last month red. a whole little heatmap, obsessed ๐
color.blame.repeatedLinesโ use the specified color to colorize line annotations forgit blame --color-lines, if they come from the same commit as the preceding line. Defaults tocyan๐color.branchโ a boolean to enable/disable color in the output ofgit-branch(1). May be set toalways,false(ornever) orauto(ortrue), in which case colors are used only when the output is to a terminal. If unset, then the value ofcolor.uiis used (autoby default) ๐ฆcolor.branch.<slot>โ use a customized color for branch coloration.<slot>is one ofcurrent(the current branch),local(a local branch),remote(a remote-tracking branch inrefs/remotes/),upstream(upstream tracking branch),plain(other refs) ๐color.diffโ whether to use ANSI escape sequences to add color to patches. If this is set toalways,git-diff(1),git-log(1), andgit-show(1)will use color for all patches. If it's set totrueorauto, those commands will only use color when the output is to the terminal. If unset, then the value ofcolor.uiis used (autoby default).
Heads up though: this does not affect git-format-patch(1) or the git-diff-* plumbing commands. And it can be overridden on the command line with the --color[=<when>] option ๐
color.diff.<slot>โ use a customized color for diff colorization.<slot>specifies which part of the patch gets the color, and is one of:contextโ context text (plainis a historical synonym)metaโ metainformationfragโ hunk headerfuncโ function in hunk headeroldโ removed linesnewโ added linescommitโ commit headerswhitespaceโ highlighting whitespace errorsoldMovedโ deleted linesnewMovedโ added linesoldMovedDimmed,oldMovedAlternative,oldMovedAlternativeDimmed,newMovedDimmed,newMovedAlternative,newMovedAlternativeDimmedโ see the<mode>setting of--color-movedingit-diff(1)for the detailscontextDimmed,oldDimmed,newDimmed,contextBold,oldBold, andnewBoldโ seegit-range-diff(1)for the details
that's a lot of slots but we don't skip any of them around here ๐
color.decorate.<slot>โ use a customized color forgit log --decorateoutput.<slot>is one ofbranch,remoteBranch,tag,stashorHEADfor local branches, remote-tracking branches, tags, stash and HEAD, respectively โ andgraftedfor grafted commits ๐ธcolor.grepโ when set toalways, always highlight matches. Whenfalse(ornever), never. When set totrueorauto, use color only when the output is written to the terminal. If unset, then the value ofcolor.uiis used (autoby default) โจcolor.grep.<slot>โ use a customized color for grep colorization.<slot>says which part of the line gets the color, and is one of:contextโ non-matching text in context lines (when using-A,-B, or-C)filenameโ filename prefix (when not using-h)functionโ function name lines (when using-p)lineNumberโ line number prefix (when using-n)columnโ column number prefix (when using--column)matchโ matching text (same as settingmatchContextandmatchSelected)matchContextโ matching text in context linesmatchSelectedโ matching text in selected lines. Also used to customize the followinggit-log(1)subcommands:--grep,--author, and--committer.selectedโ non-matching text in selected lines. Also used to customize the followinggit-log(1)subcommands:--grep,--authorand--committer.separatorโ separators between fields on a line (:,-, and=) and between hunks (--)
color.interactiveโ when set toalways, always use colors for interactive prompts and displays (like the onesgit-add --interactiveandgit-clean --interactiveuse). Whenfalse(ornever), never. When set totrueorauto, use colors only when the output is to the terminal. If unset, then the value ofcolor.uiis used (autoby default) ๐color.interactive.<slot>โ use a customized color forgit add --interactiveandgit clean --interactiveoutput.<slot>may beprompt,header,helporerror, covering four distinct types of normal output from interactive commands ๐color.pagerโ a boolean specifying whether auto color modes should colorize output going to the pager. Defaults totrue; set this tofalseif your pager doesn't understand ANSI color codes (looking at you, weird custom pager) ๐ญcolor.pushโ a boolean to enable/disable color in push errors. May be set toalways,false(ornever) orauto(ortrue), in which case colors are used only when the error output goes to a terminal. If unset, then the value ofcolor.uiis used (autoby default) ๐ฅcolor.push.errorโ use a customized color for push errors ๐color.remoteโ if set, keywords at the start of the line get highlighted. The keywords are"error","warning","hint"and"success", and they're matched case-insensitively. May be set toalways,false(ornever) orauto(ortrue). If unset, then the value ofcolor.uiis used (autoby default) ๐color.remote.<slot>โ use a customized color for each remote keyword.<slot>may behint,warning,successorerror, which match the corresponding keyword โญcolor.showBranchโ a boolean to enable/disable color in the output ofgit-show-branch(1). May be set toalways,false(ornever) orauto(ortrue), in which case colors are used only when the output is to a terminal. If unset, then the value ofcolor.uiis used (autoby default) ๐ฆcolor.statusโ a boolean to enable/disable color in the output ofgit-status(1). May be set toalways,false(ornever) orauto(ortrue), in which case colors are used only when the output is to a terminal. If unset, then the value ofcolor.uiis used (autoby default) ๐color.status.<slot>โ custom colors for status colorization, and<slot>can be literally any of these, bestie:headerโ the header text of the status messageaddedorupdatedโ files which are added but not committedchangedโ files which are changed but not added in the indexuntrackedโ files which are not tracked by Gitbranchโ the current branchnobranchโ the color the no branch warning is shown in, defaulting toredlocalBranchorremoteBranchโ the local and remote branch names, respectively, when branch and tracking information is displayed in the status short-formatunmergedโ files which have unmerged changes
color.transportโ a boolean to enable/disable color when pushes are rejected ๐ . May be set toalways,false(ornever) orauto(ortrue), in which case colors are used only when the error output goes to a terminal. If unset, then the value ofcolor.uiis used (autoby default).color.transport.rejectedโ use customized color when a push was rejected ๐ฅcolor.uiโ this variable determines the default value for variables such ascolor.diffandcolor.grepthat control the use of color per command family. Its scope will expand as more commands learn configuration to set a default for the--coloroption. Set it tofalseorneverif you prefer Git commands not to use color unless enabled explicitly with some other configuration or the--coloroption. Set it toalwaysif you want all output not intended for machine consumption to use color, totrueorauto(this is the default since Git 1.8.4) if you want such output to use color when written to the terminal. โจcolumn.uiโ specify whether supported commands should output in columns. This variable consists of a list of tokens separated by spaces or commas:
These options control when the feature should be enabled (defaults to never):
alwaysโ always show in columnsneverโ never show in columnsautoโ show in columns if the output is to the terminal
These options control layout (defaults to column). Setting any of these implies always if none of always, never, or auto are specified.
columnโ fill columns before rowsrowโ fill rows before columnsplainโ show in one column
Finally, these options can be combined with a layout option (defaults to nodense):
denseโ make unequal size columns to utilize more spacenodenseโ make equal size columns
column.branchโ specify whether to output branch listing ingit branchin columns. Seecolumn.uifor details.column.cleanโ specify the layout when listing items ingit clean -i, which always shows files and directories in columns. Seecolumn.uifor details. ๐งนcolumn.statusโ specify whether to output untracked files ingit statusin columns. Seecolumn.uifor details.column.tagโ specify whether to output tag listings ingit tagin columns. Seecolumn.uifor details.commit.cleanupโ this setting overrides the default of the--cleanupoption ingit commit. Seegit-commit(1)for details. Changing the default can be useful when you always want to keep lines that begin with the comment character (core.commentChar, default#) in your log message, in which case you would dogit config commit.cleanup whitespace(note that you will have to remove the help lines that begin with the comment character in the commit log template yourself, if you do this). ๐commit.gpgSignโ a boolean to specify whether all commits should be GPG signed. Use of this option when doing operations such as rebase can result in a large number of commits being signed. It may be convenient to use an agent to avoid typing your GPG passphrase several times. ๐commit.statusโ a boolean to enable/disable inclusion of status information in the commit message template when using an editor to prepare the commit message. Defaults totrue.commit.templateโ specify the pathname of a file to use as the template for new commit messages. ๐commit.verboseโ a boolean or int to specify the level of verbosity withgit commit. Seegit-commit(1)for details.commitGraph.generationVersionโ specifies the type of generation number version to use when writing or reading the commit-graph file. If version1is specified, then the corrected commit dates will not be written or read. Defaults to2.commitGraph.maxNewFiltersโ specifies the default value for the--max-new-filtersoption ofgit commit-graph write(c.f.,git-commit-graph(1)).commitGraph.changedPathsโ if true, thengit commit-graph writewill compute and write changed-path Bloom filters by default, equivalent to passing--changed-paths. If false or unset, changed-paths Bloom filters will be written duringgit commit-graph writeonly if the filters already exist in the current commit-graph file. This matches the default behavior ofgit commit-graph writewithout any--[no-]changed-pathsoption. To rewrite a commit-graph file without any filters, use the--no-changed-pathsoption. Command-line option--[no-]changed-pathsalways takes precedence over this configuration. Defaults to unset.commitGraph.readChangedPathsโ Deprecated. Equivalent tocommitGraph.changedPathsVersion=-1if true, andcommitGraph.changedPathsVersion=0if false. (IfcommitGraph.changedPathVersionis also set,commitGraph.changedPathsVersiontakes precedence.) ๐commitGraph.changedPathsVersionโ specifies the version of the changed-path Bloom filters that Git will read and write. May be-1,0,1, or2. Note that values greater than1may be incompatible with older versions of Git which do not yet understand those versions. Use caution when operating in a mixed-version environment.
Defaults to -1.
- If
-1, Git will use the version of the changed-path Bloom filters in the repository, defaulting to1if there are none. - If
0, Git will not read any Bloom filters, and will write version1Bloom filters when instructed to write. - If
1, Git will only read version1Bloom filters, and will write version1Bloom filters. - If
2, Git will only read version2Bloom filters, and will write version2Bloom filters.
See git-commit-graph(1) for more information.
completion.commandsโ this is only used bygit-completion.bashto add or remove commands from the list of completed commands. Normally only porcelain commands and a few select others are completed. You can add more commands, separated by space, in this variable. Prefixing the command with-will remove it from the existing list. ๐ธcore.fileModeโ tells Git if the executable bit of files in the working tree is to be honored.
Some filesystems lose the executable bit when a file that is marked as executable is checked out, or checks out a non-executable file with executable bit on. git-clone(1) or git-init(1) probe the filesystem to see if it handles the executable bit correctly and this variable is automatically set as necessary.
A repository, however, may be on a filesystem that handles the filemode correctly, and this variable is set to true when created, but later may be made accessible from another environment that loses the filemode (e.g. exporting ext4 via CIFS mount, visiting a Cygwin created repository with Git for Windows or Eclipse). In such a case it may be necessary to set this variable to false. See git-update-index(1).
The default is true (when core.filemode is not specified in the config file).
core.hideDotFilesโ (Windows-only ๐ช) Iftrue, mark newly-created directories and files whose name starts with a dot as hidden. IfdotGitOnly, only the.git/directory is hidden, but no other files starting with a dot. The default mode isdotGitOnly.core.ignoreCaseโ internal variable which enables various workarounds to enable Git to work better on filesystems that are not case sensitive, like APFS, HFS+, FAT, NTFS, etc. For example, if a directory listing finds"makefile"when Git expects"Makefile", Git will assume it is really the same file, and continue to remember it as"Makefile".
The default is false, except git-clone(1) or git-init(1) will probe and set core.ignoreCase true if appropriate when the repository is created.
Git relies on the proper configuration of this variable for your operating and file system. Modifying this value may result in unexpected behavior. โ ๏ธ
core.precomposeUnicodeโ this option is only used by Mac OS implementation of Git. Whencore.precomposeUnicode=true, Git reverts the unicode decomposition of filenames done by Mac OS. This is useful when sharing a repository between Mac OS and Linux or Windows. (Git for Windows 1.7.10 or higher is needed, or Git under cygwin 1.7). Whenfalse, file names are handled fully transparent by Git, which is backward compatible with older versions of Git. ๐core.protectHFSโ if set totrue, do not allow checkout of paths that would be considered equivalent to.giton an HFS+ filesystem. Defaults totrueon Mac OS, andfalseelsewhere. ๐ก๏ธcore.protectNTFSโ if set totrue, do not allow checkout of paths that would cause problems with the NTFS filesystem, e.g. conflict with 8.3 "short" names. Defaults totrueon Windows, andfalseelsewhere. ๐ก๏ธcore.fsmonitorโ if set totrue, enable the built-in file system monitor daemon for this working directory (git-fsmonitor--daemon(1)).
Like hook-based file system monitors, the built-in file system monitor can speed up Git commands that need to refresh the Git index (e.g. git status) in a working directory with many files. The built-in monitor eliminates the need to install and maintain an external third-party tool.
The built-in file system monitor is currently available only on a limited set of supported platforms. Currently, this includes Windows and MacOS.
Otherwise, this variable contains the pathname of the "fsmonitor" hook command.
This hook command is used to identify all files that may have changed since the requested date/time. This information is used to speed up git by avoiding unnecessary scanning of files that have not changed.
See the "fsmonitor-watchman" section of githooks(5). ๐
โ ๏ธ ok bestie, real talk first โ a warning that is genuinely important if you're juggling multiple Git versions at once (like one on the command line and another inside your IDE, which honestly, same) ๐ the definition of core.fsmonitor got extended to allow boolean values on top of hook pathnames. Which means:
- Git
2.35.1and prior? They do not get the boolean values. They'll look at"true"or"false"and go "ah yes, a hook pathname, let me invoke that" โ iconic of them, but wrong. - Git
2.26thru2.35.1? They default to hook protocolV2, and they'll fall back to no fsmonitor (aka a full scan). - Git versions prior to
2.26? They default to hook protocolV1and will silently assume nothing changed at all (no scan), so your status commands may report incomplete results. ๐ญ
So for this reason, it is best to upgrade all of your Git versions before you start using the built-in file system monitor. No cap. โจ
core.fsmonitorHookVersion
Sets the protocol version to be used when invoking the "fsmonitor" hook. ๐
There are currently versions 1 and 2. When this is not set, version 2 will be tried first and if it fails then version 1 will be tried. Version 1 uses a timestamp as input to determine which files have changes since that time, but some monitors like Watchman have race conditions when used with a timestamp ๐ฌ. Version 2 uses an opaque string so that the monitor can return something that can be used to determine what files have changed without race conditions. slay.
core.trustctime
If false, the ctime differences between the index and the working tree are ignored โ super useful when the inode change time is regularly modified by something outside Git (looking at you, file system crawlers and some backup systems ๐). See git-update-index(1). True by default.
core.splitIndex
If true, the split-index feature of the index will be used. See git-update-index(1). False by default.
core.untrackedCache
Determines what to do about the untracked cache feature of the index ๐ง:
- It will be kept, if this variable is unset or set to
keep. - It will automatically be added if set to
true. - And it will automatically be removed, if set to
false.
Before you set it to true, please please please check that mtime is working properly on your system ๐ซถ. See git-update-index(1). keep by default, unless feature.manyFiles is enabled, which sets this setting to true by default.
core.checkStat
When missing or is set to default, many fields in the stat structure are checked to detect if a file has been modified since Git looked at it. When this configuration variable is set to minimal, the sub-second part of mtime and ctime, the uid and gid of the owner of the file, the inode number (and the device number, if Git was compiled to use it), are excluded from the check among these fields โ leaving only the whole-second part of mtime (and ctime, if core.trustCtime is set) and the filesize to be checked. โจ
There are implementations of Git that do not leave usable values in some fields (e.g. JGit); by excluding these fields from the comparison, the minimal mode may help interoperability when the same repository is used by these other systems at the same time. teamwork ๐
core.quotePath
Commands that output paths (e.g. ls-files, diff), will quote "unusual" characters in the pathname by enclosing the pathname in double-quotes and escaping those characters with backslashes in the same way C escapes control characters (e.g. \t for TAB, \n for LF, \\ for backslash) or bytes with values larger than 0x80 (e.g. octal \302\265 for "micro" in UTF-8). If this variable is set to false, bytes higher than 0x80 are not considered "unusual" any more. Double-quotes, backslash and control characters are always escaped regardless of the setting of this variable. A simple space character is not considered "unusual". Many commands can output pathnames completely verbatim using the -z option. The default value is true.
core.eol
Sets the line ending type to use in the working directory for files that are marked as text (either by having the text attribute set, or by having text=auto and Git auto-detecting the contents as text). Alternatives are lf, crlf and native, which uses the platform's native line ending ๐ธ. The default value is native. See gitattributes(5) for more information on end-of-line conversion. Note that this value is ignored if core.autocrlf is set to true or input. ๐
core.safecrlf
If true, makes Git check if converting CRLF is reversible when end-of-line conversion is active. Git will verify if a command modifies a file in the work tree either directly or indirectly. For example, committing a file followed by checking out the same file should yield the original file in the work tree. If this is not the case for the current setting of core.autocrlf, Git will reject the file. The variable can be set to "warn", in which case Git will only warn about an irreversible conversion but continue the operation. โ ๏ธ
CRLF conversion bears a slight chance of corrupting data. When it is enabled, Git will convert CRLF to LF during commit and LF to CRLF during checkout. A file that contains a mixture of LF and CRLF before the commit cannot be recreated by Git. For text files this is the right thing to do: it corrects line endings such that we have only LF line endings in the repository. But for binary files that are accidentally classified as text, the conversion can corrupt data. ๐
If you recognize such corruption early you can easily fix it by setting the conversion type explicitly in .gitattributes. Right after committing you still have the original file in your work tree and this file is not yet corrupted. You can explicitly tell Git that this file is binary and Git will handle the file appropriately. ๐ซถ
Unfortunately, the desired effect of cleaning up text files with mixed line endings and the undesired effect of corrupting binary files cannot be distinguished. In both cases CRLFs are removed in an irreversible way. For text files this is the right thing to do because CRLFs are line endings, while for binary files converting CRLFs corrupts data. ๐ญ
Note: this safety check does not mean that a checkout will generate a file identical to the original file for a different setting ofcore.eolandcore.autocrlfโ only for the current one. For example, a text file with LF would be accepted withcore.eol=lfand could later be checked out withcore.eol=crlf, in which case the resulting file would contain CRLF, although the original file contained LF. However, in both work trees the line endings would be consistent, that is either all LF or all CRLF, but never mixed. A file with mixed line endings would be reported by thecore.safecrlfmechanism. โจ
core.autocrlf
Setting this variable to "true" is the same as setting the text attribute to "auto" on all files and core.eol to "crlf". Set to true if you want to have CRLF line endings in your working directory and the repository has LF line endings. This variable can be set to input, in which case no output conversion is performed. ๐
core.checkRoundtripEncoding
A comma and/or whitespace separated list of encodings that Git performs UTF-8 round trip checks on if they are used in a working-tree-encoding attribute (see gitattributes(5)). The default value is SHIFT-JIS. ๐
core.symlinks
If false, symbolic links are checked out as small plain files that contain the link text. git-update-index(1) and git-add(1) will not change the recorded type to regular file. Useful on filesystems like FAT that do not support symbolic links. ๐ฆ
The default is true, except git-clone(1) or git-init(1) will probe and set core.symlinks false if appropriate when the repository is created.
core.gitProxy
A "proxy command" to execute (as command host port) instead of establishing a direct connection to the remote server when using the Git protocol for fetching. If the variable value is in the "COMMAND for DOMAIN" format, the command is applied only on hostnames ending with the specified domain string. This variable may be set multiple times and is matched in the given order; the first match wins. ๐
Can be overridden by the GIT_PROXY_COMMAND environment variable (which always applies universally, without the special "for" handling).
The special string none can be used as the proxy command to specify that no proxy be used for a given domain pattern. This is useful for excluding servers inside a firewall from proxy use, while defaulting to a common proxy for external domains. ๐ฅ
core.sshCommand
If this variable is set, git fetch and git push will use the specified command instead of ssh when they need to connect to a remote system. The command is in the same form as the GIT_SSH_COMMAND environment variable and is overridden when the environment variable is set.
core.ignoreStat
If true, Git will avoid using lstat() calls to detect if files have changed by setting the "assume-unchanged" bit for those tracked files which it has updated identically in both the index and working tree.
When files are modified outside of Git, the user will need to stage the modified files explicitly (e.g. see Examples section in git-update-index(1)). Git will not normally detect changes to those files. ๐
This is useful on systems where lstat() calls are very slow, such as CIFS/Microsoft Windows.
False by default.
core.preferSymlinkRefs
Instead of the default "symref" format for HEAD and other symbolic reference files, use symbolic links. This is sometimes needed to work with old scripts that expect HEAD to be a symbolic link.
๐จ This configuration is deprecated and will be removed in Git 3.0. Symbolic refs will always be written as textual symrefs. Don't get attached, bestie.
core.alternateRefsCommand
When advertising tips of available history from an alternate, use the shell to execute the specified command instead of git-for-each-ref(1). The first argument is the absolute path of the alternate. Output must contain one hex object id per line (i.e., the same as produced by git for-each-ref --format='%(objectname)'). โญ
๐ก Heads up: you cannot generally put git for-each-ref directly into the config value, as it does not take a repository path as an argument (but you can wrap the command above in a shell script). iykyk ๐ง
okay so next up, more core.* settings โ these are the ones that lowkey control how your repo behaves under the hood ๐
core.alternateRefsPrefixesโ when you're listing refs from an alternate, this says: only show refs that start with the prefix you give it. The prefixes match exactly like they would if you passed them as arguments togit-for-each-ref(1). Wanna list multiple prefixes? Just separate them with whitespace. โจ but heads up: ifcore.alternateRefsCommandis set, then settingcore.alternateRefsPrefixesliterally has no effect. periodt.core.bareโ if this istrue, the repo is assumed to be bare and has no working directory attached to it. And when that's the case, a bunch of commands that need a working directory get disabled โ likegit-add(1)orgit-merge(1). ๐ญ this setting gets automatically guessed bygit-clone(1)orgit-init(1)when the repo was created. By default, a repo that ends in"/.git"is assumed to be not bare (bare = false), while all other repos are assumed to be bare (bare = true). it's giving "automatic vibe check" ngl.core.worktreeโ sets the path to the root of the working tree. ๐ณ but if theGIT_COMMON_DIRenvironment variable is set, thencore.worktreeis ignored and not used for determining the root of the working tree. this can be overridden by theGIT_WORK_TREEenvironment variable and the--work-treecommand-line option. the value can be an absolute path or relative to the path to the.gitdirectory, which is either specified by--git-dirorGIT_DIR, or automatically discovered. if--git-dirorGIT_DIRis specified but none of--work-tree,GIT_WORK_TREEandcore.worktreeis specified, then the current working directory is regarded as the top level of your working tree.
โ ๏ธ note: this variable is honored even when set in a configuration file in a".git"subdirectory of a directory and its value differs from the latter directory (e.g."/path/to/.git/config"hascore.worktreeset to"/different/path"), which is most likely a misconfiguration. running Git commands in the"/path/to"directory will still use"/different/path"as the root of the work tree and can cause confusion unless you know what you are doing (e.g. you are creating a read-only snapshot of the same index to a location different from the repositoryโs usual working tree). bestie, pls don't do this accidentally ๐
core.lockfilePidโ iftrue, Git will create a PID file alongside lock files. when a lock acquisition fails and a PID file exists, Git can provide additional diagnostic information about the process holding the lock, including whether it is still running. defaults tofalse. the PID file is named by inserting~pidbefore the.locksuffix. for example, if the lock file isindex.lock, the PID file will beindex~pid.lock. the file contains a single line in the formatpid <value>followed by a newline. ๐ detective mode: activated.core.logAllRefUpdatesโ enables the reflog. updates to a ref<ref>are logged to the file"$GIT_DIR/logs/<ref>", by appending the new and old SHA-1, the date/time and the reason of the update โ but only when the file exists. if this config variable is set totrue, a missing"$GIT_DIR/logs/<ref>"file is automatically created for branch heads (i.e. underrefs/heads/), remote refs (i.e. underrefs/remotes/), note refs (i.e. underrefs/notes/), and the symbolic refHEAD. if it is set toalways, then a missing reflog is automatically created for any ref underrefs/. this info can be used to determine what commit was the tip of a branch"2 days ago". ๐ฐ๏ธ this value istrueby default in a repository that has a working directory associated with it, andfalseby default in a bare repository.core.repositoryFormatVersionโ internal variable identifying the repository format and layout version. seegitrepository-layout(5). don't touch unless you know what you're doing, iykyk ๐ซถcore.sharedRepositoryโ when set togroup(ortrue), the repository is made shareable between several users in a group (making sure all the files and objects are group-writable). when set toall(orworldoreverybody), the repository will be readable by all users, additionally to being group-shareable. when set toumask(orfalse), Git will use permissions reported byumask(2). when set to0xxx, where0xxxis an octal number, files in the repository will have this mode value.0xxxwill override the userโs umask value (whereas the other options will only override requested parts of the userโs umask value). examples:0660will make the repo read/write-able for the owner and group, but inaccessible to others (equivalent togroupunless umask is e.g.0022).0640is a repository that is group-readable but not group-writable. seegit-init(1).falseby default. ๐ permissions are a whole vibe.core.warnAmbiguousRefsโ iftrue, Git will warn you if the ref name you passed it is ambiguous and might match multiple refs in the repository.trueby default. so yes, it's looking out for you ๐ฅบcore.compressionโ an integer-1..9, indicating a default compression level.-1is the zlib default.0means no compression, and1..9are various speed/size tradeoffs,9being slowest. if set, this provides a default to other compression variables, such ascore.looseCompressionandpack.compression. ๐ฅ choose your fighter.core.looseCompressionโ an integer-1..9, indicating the compression level for objects that are not in a pack file.-1is the zlib default.0means no compression, and1..9are various speed/size tradeoffs,9being slowest. if not set, defaults tocore.compression. if that is not set, defaults to1(best speed). โก speed over size, bestie.core.packedGitWindowSizeโ number of bytes of a pack file to map into memory in a single mapping operation. larger window sizes may allow your system to process a smaller number of large pack files more quickly. smaller window sizes will negatively affect performance due to increased calls to the operating systemโs memory manager, but may improve performance when accessing a large number of large pack files. default is1 MiBifNO_MMAPwas set at compile time, otherwise32 MiBon 32 bit platforms and1 GiBon 64 bit platforms. this should be reasonable for all users/operating systems. you probably do not need to adjust this value. common unit suffixes ofk,m, orgare supported. ๐ง leave it alone, fr fr.core.packedGitLimitโ maximum number of bytes to map simultaneously into memory from pack files. if Git needs to access more than this many bytes at once to complete an operation it will unmap existing regions to reclaim virtual address space within the process. default is256 MiBon 32 bit platforms and32 TiB(effectively unlimited) on 64 bit platforms. this should be reasonable for all users/operating systems, except on the largest projects. you probably do not need to adjust this value. common unit suffixes ofk,m, orgare supported. ๐ซถ again: probably don't touch.core.deltaBaseCacheLimitโ maximum number of bytes per thread to reserve for caching base objects that may be referenced by multiple deltified objects. by storing the entire decompressed base objects in a cache Git is able to avoid unpacking and decompressing frequently used base objects multiple times. default is96 MiBon all platforms. this should be reasonable for all users/operating systems, except on the largest projects. you probably do not need to adjust this value. common unit suffixes ofk,m, orgare supported. ๐ธ caching queen.core.bigFileThresholdโ the size of files considered"big", which as discussed below changes the behavior of numerous git commands, as well as how such files are stored within the repository. the default is512 MiB. common unit suffixes ofk,m, orgare supported. files above the configured limit will be:- stored deflated in packfiles, without attempting delta compression. the default limit is primarily set with this use-case in mind. with it, most projects will have their source code and other text files delta compressed, but not larger binary media files. storing large files without delta compression avoids excessive memory usage, at the slight expense of increased disk usage. ๐ big files get special treatment.
- will be treated as if they were labeled
"binary"(seegitattributes(5)). e.g.git-log(1)andgit-diff(1)will not compute diffs for files above this limit. - will generally be streamed when written, which avoids excessive memory usage, at the cost of some fixed overhead. commands that make use of this include
git-archive(1),git-fast-import(1),git-index-pack(1),git-unpack-objects(1)andgit-fsck(1). ๐ฅ stream team.
core.excludesFileโ specifies the pathname to the file that contains patterns to describe paths that are not meant to be tracked, in addition to.gitignore(per-directory) and.git/info/exclude. defaults to$XDG_CONFIG_HOME/git/ignore. if$XDG_CONFIG_HOMEis either not set or empty,$HOME/.config/git/ignoreis used instead. seegitignore(5). ๐ the "not me" list.core.askPassโ some commands (e.g.svnandhttpinterfaces) that interactively ask for a password can be told to use an external program given via the value of this variable. can be overridden by theGIT_ASKPASSenvironment variable. if not set, fall back to the value of theSSH_ASKPASSenvironment variable or, failing that, a simple password prompt. the external program shall be given a suitable prompt as command-line argument and write the password on itsSTDOUT. ๐ password helper, slay.core.attributesFileโ specifies the pathname to the file that contains attributes (seegitattributes(5)), in addition to.gitattributes(per-directory) and.git/info/attributes. its default value is$XDG_CONFIG_HOME/git/attributes. if$XDG_CONFIG_HOMEis either not set or empty,$HOME/.config/git/attributesis used instead. ๐ attributes but make it global.core.hooksPathโ by default Git will look for your hooks in the$GIT_DIR/hooksdirectory. set this to a different path, e.g./etc/git/hooks, and Git will try to find your hooks in that directory, e.g./etc/git/hooks/pre-receiveinstead of in$GIT_DIR/hooks/pre-receive. the path can be either absolute or relative. a relative path is taken as relative to the directory where the hooks are run (see the"DESCRIPTION"section ofgithooks(5)). this config variable is useful in cases where youโd like to centrally configure your Git hooks instead of configuring them on a per-repository basis, or as a more flexible and centralized alternative to having aninit.templateDirwhere youโve changed default hooks. ๐ centralize your hooks, main character energy.
okay one more core.hooksPath thing before we move on: you can also disable all hooks entirely by setting core.hooksPath to /dev/null. That is usually only advisable for expert users, and on a per-command basis using configuration parameters of the form git -c core.hooksPath=/dev/null ... ๐ซถ
core.editorโ commands likecommitandtagthat let you edit messages by launching an editor grab this value, but only when it's set and theGIT_EDITORenvironment variable is not set. More deets ingit-var(1)โ๏ธcore.commentChar,core.commentStringโ commands likecommitandtagthat let you edit messages treat a line starting with this character as a comment, and strip those lines out after the editor returns (default is#) ๐
If you set it to auto, git-commit will pick a character that isn't the starting character of any line in your existing commit messages. Support for this value is deprecated and will be removed in Git 3.0, because of these limitations:
- it's incompatible with adding comments in a commit message template โ and that includes the conflicts comments added to the commit message by
cherry-pick,merge,rebaseandrevert๐ฌ - it's incompatible with adding comments to the commit message in the
prepare-commit-msghook - it's incompatible with the
fixupandsquashcommands when rebasing, - it is not respected by
git notes
Heads up: these two variables are aliases of each other, and in modern versions of Git you're free to use a whole string (e.g. // or โโโ) with commentChar. Versions of Git prior to v2.45.0 will ignore commentString but will reject a value of commentChar that's more than a single ASCII byte. So if you plan to use your config with both older and newer versions of Git, you may want to specify both:
[core]
# single character for older versions
commentChar = "#"
# string for newer versions (which will override commentChar
# because it comes later in the file)
commentString = "//"
core.filesRefLockTimeoutโ how long, in milliseconds, to keep retrying when trying to lock an individual reference. Value0means don't retry at all;-1means try indefinitely. Default is100(i.e. retry for 100ms) โฑ๏ธcore.packedRefsTimeoutโ same energy, but for trying to lock thepacked-refsfile. Value0means no retrying at all;-1means try indefinitely. Default is1000(i.e. retry for 1 second)core.configLockTimeoutโ the retry window, in milliseconds, for trying to lock a configuration file for writing. Value0means don't retry at all;-1means try indefinitely. Default is1000(i.e. retry for 1 second). This one is read from the configuration that's already on disk before the lock is taken, so you can set it persistently like any other option ๐core.pagerโ the text viewer Git commands use (e.g.less). The value is meant to be interpreted by the shell. Order of preference is: the$GIT_PAGERenvironment variable, thencore.pagerconfig, then$PAGER, and then whatever default was chosen at compile time (usuallyless) ๐
When the LESS environment variable is unset, Git sets it to FRX (if LESS is set, Git does not change it at all). Want to selectively override Git's default LESS setting? Set core.pager to e.g. less -S. Git passes that to the shell, which translates the final command to LESS=FRX less -S. The environment does not set the S option but the command line does, instructing less to truncate long lines. Similarly, setting core.pager to less -+F deactivates the F option specified by the environment from the command-line, deactivating the "quit if one screen" behavior of less. And you can specifically activate some flags for particular commands: for example, setting pager.blame to less -S enables line truncation only for git blame โจ
Likewise, when the LV environment variable is unset, Git sets it to -c. You can override this setting by exporting LV with another value or setting core.pager to lv +c.
core.whitespaceโ a comma separated list of common whitespace problems to notice.git diffwill usecolor.diff.whitespaceto highlight them, andgit apply --whitespace=errorwill consider them as errors. You can prefix-to disable any of them (e.g.-trailing-space):blank-at-eoltreats trailing whitespaces at the end of the line as an error (enabled by default) ๐งนspace-before-tabtreats a space character that appears immediately before a tab character in the initial indent part of the line as an error (enabled by default)indent-with-non-tabtreats a line that is indented with space characters instead of the equivalent tabs as an error (not enabled by default)tab-in-indenttreats a tab character in the initial indent part of the line as an error (not enabled by default)blank-at-eoftreats blank lines added at the end of file as an error (enabled by default)trailing-spaceis a short-hand to cover bothblank-at-eolandblank-at-eofcr-at-eoltreats a carriage-return at the end of line as part of the line terminator, i.e. with it,trailing-spacedoes not trigger if the character before such a carriage-return is not a whitespace (not enabled by default)incomplete-linetreats the last line of a file that is missing the newline at the end as an error (not enabled by default)tabwidth=<n>tells how many character positions a tab occupies; this is relevant forindent-with-non-taband when Git fixestab-in-indenterrors. The default tab width is8. Allowed values are1to63๐
core.fsyncโ a comma-separated list of components of the repository that should be hardened via thecore.fsyncMethodwhen created or modified. You can disable hardening of any component by prefixing it with a-. Items that are not hardened may be lost in the event of an unclean system shutdown ๐ญ Unless you have special requirements, it is recommended that you leave this option empty or pick one ofcommitted,added, orall.
When this configuration is encountered, the set of components starts with the platform default value, disabled components are removed, and additional components are added. none resets the state so that the platform default is ignored.
The empty string resets the fsync configuration to the platform default. The default on most platforms is equivalent to core.fsync=committed,-loose-object, which has good performance, but risks losing recent work in the event of an unclean system shutdown ๐
noneclears the set of fsynced componentsloose-objecthardens objects added to the repo in loose-object formpackhardens objects added to the repo in packfile formpack-metadatahardens packfile bitmaps and indexescommit-graphhardens thecommit-graphfileindexhardens the index when it is modifiedobjectsis an aggregate option that is equivalent toloose-object,packreferencehardens references modified in the repoderived-metadatais an aggregate option that is equivalent topack-metadata,commit-graphcommittedis an aggregate option that is currently equivalent toobjects. This mode sacrifices some performance to ensure that work that is committed to the repository withgit commitor similar commands is hardened ๐ชaddedis an aggregate option that is currently equivalent tocommitted,index. This mode sacrifices additional performance to ensure that the results of commands likegit addand similar operations are hardenedallis an aggregate option that syncs all individual components above ๐
core.fsyncMethodโ a value indicating the strategy Git will use to harden repository data usingfsyncand related primitives.fsyncuses thefsync()system call or platform equivalentswriteout-onlyissues pagecache writeback requests, but depending on the filesystem and storage hardware, data added to the repository may not be durable in the event of a system crash. This is the default mode on macOS ๐batchenables a mode that uses writeout-only flushes to stage multiple updates in the disk writeback cache and then does a single fullfsyncof a dummy file to trigger the disk cache flush at the end of the operation.
Currently batch mode only applies to loose-object files. Other repository data is made durable as if fsync was specified. This mode is expected to be as safe as fsync on macOS for repos stored on HFS+ or APFS filesystems and on Windows for repos stored on NTFS or ReFS filesystems ๐ธ
core.fsyncObjectFilesโ this boolean will enablefsync()when writing object files. This setting is deprecated. Usecore.fsyncinstead. โ ๏ธ
This setting affects data added to the Git repository in loose-object form. When set to true, Git will issue an fsync or similar system call to flush caches so that loose-objects remain consistent in the face of a unclean system shutdown.
core.preloadIndexโ enable parallel index preload for operations likegit diff๐
This can speed up operations like git diff and git status, especially on filesystems like NFS that have weak caching semantics and thus relatively high IO latencies. When enabled, Git will do the index comparison to the filesystem data in parallel, allowing overlapping IO's. Defaults to true.
core.unsetenvvarsโ Windows-only: a comma-separated list of environment variables' names that need to be unset before spawning any other process. Defaults toPERL5LIB, to account for the fact that Git for Windows insists on using its own Perl interpreter ๐ชcore.createObjectโ you can set this tolink, in which case a hardlink followed by a delete of the source are used to make sure that object creation will not overwrite existing objects.
On some file system/operating system combinations, this is unreliable ๐ฌ Set this config setting to rename there; however, this will remove the check that makes sure that existing object files will not get overwritten. So likeโฆ pick your fighter, bestie ๐
core.notesRefโ this is the one that says which notes get shown when you're looking at commit messages, bestie. It has to be a fully qualified ref, so no shortcuts ๐ . And okay, plot twist: if the ref you named doesn't exist, that's not an error โ it just means nothing gets printed, which honestly is a mood. The default isrefs/notes/commits, butGIT_NOTES_REFcan totally override it. Go read git-notes(1) for the full tea ๐ซถ.core.commitGraphโ set this to true and git will read the commit-graph file (if there even is one) to parse out the commit graph structure. Defaults to<green>true</green>โจ. See git-commit-graph(1) for more.core.useReplaceRefsโ flip this tofalseand git acts like you handed it the--no-replace-objectsoption on the command line, no cap. Check git(1) and git-replace(1) for the details ๐ฅ.core.multiPackIndexโ use the multi-pack-index file so you can track a whole bunch of packfiles with one single index. See git-multi-pack-index(1). Defaults to<green>true</green>๐.core.sparseCheckoutโ turns on the "sparse checkout" feature. See git-sparse-checkout(1) for more ๐ฆ.core.sparseCheckoutConeโ enables "cone mode" for sparse checkout. When your sparse-checkout file only has a limited set of patterns, this mode gives you significant performance advantages, lowkey iconic โญ. And if you want "non-cone mode" instead so you can specify more flexible patterns, just set this variable tofalse. See git-sparse-checkout(1) for more.core.abbrevโ sets how long abbreviated object names are. Leave it unspecified or set it to"auto"and git computes an appropriate value based on the approximate number of packed objects in your repo โ which, hopefully, is enough to keep the abbreviated object names unique for a while ๐. Set it to"no"and no abbreviation happens at all, object names show up at full length. Minimum length is4, periodt.core.maxTreeDepthโ the maximum depth git is willing to recurse while traversing a tree (like,a/b/cde/fhas a depth of4, iykyk). This is a fail-safe so git can abort cleanly, and you should generally not need to touch it. When git is compiled with MSVC the default is512, otherwise the default is2048๐ง.credential.helperโ names the external helper to call when a username or password credential is needed. The helper can go dig through external storage so you don't get prompted for your creds ๐. Normally this is the name of a credential helper with possible arguments, but it can also be an absolute path with arguments or, if it's preceded by!, shell commands. Also note: multiple helpers can be defined. See gitcredentials(7) for the details and examples ๐ซถ.credential.interactiveโ by default, git and any configured credential helpers will ask you for input when new credentials are required. A lot of these helpers will succeed off stored credentials as long as those creds are still valid. To avoid any possibility of user interactivity from git, setcredential.interactive=false. Some credential helpers respect this option too ๐.credential.useHttpPathโ when acquiring credentials, treat the "path" component of anhttporhttpsURL as important. Defaults to<red>false</red>. See gitcredentials(7) for more ๐ธ.credential.sanitizePromptโ by default, user names and hosts that show up as part of the password prompt aren't allowed to contain control characters (they get URL-encoded by default). Configure this setting tofalseto override that behavior ๐.credential.protectProtocolโ by default, Carriage Return characters are not allowed in the protocol used when git talks to a credential helper. This setting lets users override that default.credential.usernameโ if no username is set for a network authentication, use this username by default. Seecredential.<context>.*below, and gitcredentials(7) ๐.credential.<url>.*โ literally any of thecredential.*options above can be applied selectively to some credentials ๐. Like,"credential.https://example.com.username"would set the default username only for https connections to example.com. See gitcredentials(7) for how URLs get matched ๐.credentialCache.ignoreSIGHUPโ tellsgit-credential-cache--daemonto ignoreSIGHUPinstead of quitting ๐ญ.credentialStore.lockTimeoutMSโ how long, in milliseconds,git-credential-storeretries when trying to lock the credentials file.0means don't retry at all;-1means try indefinitely. Default is1000(so, retry for 1s) โญ.
diff.autoRefreshIndexโ when you usegit diffto compare against work tree files, don't count stat-only changes as changed, okay? Instead it silently runsgit update-index --refreshto update the cached stat info for paths whose contents in the work tree match the contents in the index. Defaults to<green>true</green>. Important caveat bestie: this affects onlygit diffPorcelain, not lower level diff commands likegit diff-files๐.diff.dirstatโ a comma separated list of--dirstatparameters setting the default behavior of the--dirstatoption for git-diff(1) and friends โจ. You can override the defaults on the command line (with--dirstat=<param>,...). The fallback defaults (whendiff.dirstatdoesn't change anything) arechanges,noncumulative,3. Here's what's available:changesโ compute the dirstat numbers by counting the lines removed from the source or added to the destination. This ignores how much pure code movement happened inside a file. In other words, rearranging lines in a file doesn't count as much as other changes. This is the default behavior when no parameter is given ๐ .linesโ compute the dirstat numbers by doing the regular line-based diff analysis and summing the removed/added line counts. (For binary files, count64-byte chunks instead, since binary files have no natural concept of lines ๐ซ ). This is a more expensive--dirstatbehavior thanchanges, but it does count rearranged lines inside a file as much as other changes. The output you get is consistent with the other--*statoptions ๐.filesโ compute the dirstat numbers by counting the number of files changed. Each changed file counts equally in the dirstat analysis. This is the computationally cheapest--dirstatbehavior since it doesn't have to look at file contents at all ๐.cumulativeโ count changes in a child directory for the parent directory too. Note that withcumulative, the sum of the percentages reported may exceed100%๐ญ. The default (non-cumulative) behavior can be specified with thenoncumulativeparameter.<limit>โ an integer parameter specifying a cut-off percent (3%by default). Directories contributing less than this percentage of the changes aren't shown in the output ๐.
Example: the following will count changed files, ignore directories with less than10%of the total amount of changed files, and accumulate child directory counts in the parent directories:files,10,cumulative๐ฅ.
diff.statNameWidthโ limits the width of the filename part in--statoutput. If set, it applies to all commands generating--statoutput exceptformat-patchโจ.diff.statGraphWidthโ limits the width of the graph part in--statoutput. If set, it applies to all commands generating--statoutput exceptformat-patchโจ.diff.contextโ generate diffs with <n> lines of context instead of the default of3. This value gets overridden by the-Uoption.diff.interHunkContextโ show the context between diff hunks, up to the specified number of lines, which fuses hunks that are close to each other ๐ฆ. This value serves as the default for the--inter-hunk-contextcommand line option.diff.externalโ if this config variable is set, diff generation isn't done with the internal diff machinery, it's done with the given command ๐ . Can be overridden with theGIT_EXTERNAL_DIFFenvironment variable. The command gets called with parameters as described under "git Diffs" in git(1).
Note: if you only want an external diff program on a subset of your files, you might want to use gitattributes(5) instead ๐.
diff.trustExitCodeโ if this boolean istrue, then thediff.externalcommand is expected to return exit code0when it thinks the input files are equal, or1when it thinks they're different, just like diff(1). If it'sfalseโ which is the default โ the command is expected to return exit code0regardless of equality. Any other exit code causes git to report a fatal error ๐.diff.ignoreSubmodulesโ sets the default value of--ignore-submodules๐. Heads up: this affects onlygit diffPorcelain, not lower level diff commands likegit diff-files.git checkoutandgit switchalso honor this setting when reporting uncommitted changes. Setting it toalldisables the submodule summary normally shown bygit commitandgit statuswhenstatus.submoduleSummaryis set โ unless it's overridden with the--ignore-submodulescommand-line option. Thegit submodulecommands are not affected by this setting. By default this is set tountrackedso any untracked submodules get ignored ๐.diff.mnemonicPrefixโ if set,git diffuses a prefix pair that's different from the standarda/andb/depending on what's being compared. When this config is in effect, reverse diff output also swaps the order of the prefixes ๐:git diffโ compares the (i)ndex and the (w)ork tree;git diff HEADโ compares a (c)ommit and the (w)ork tree;git diff --cachedโ compares a (c)ommit and the (i)ndex;git diff HEAD:<file1> <file2>โ compares an (o)bject and a (w)ork tree entity;git diff --no-index <a> <b>โ compares two non-git things <a> and <b> ๐ฆ.
diff.noPrefixโ if set,git diffdoesn't show any source or destination prefix ๐ซ.diff.srcPrefixโ if set,git diffuses this source prefix. Defaults toa/๐.diff.dstPrefixโ if set,git diffuses this destination prefix. Defaults tob/๐.
okay so the config file has strong feelings about how diffs are done, and honestly? valid. here's the whole diff.* lineup ๐
diff.relativeโ set this bad boy totrueandgit diffstops showing you changes from outside the directory you're standing in, plus it shows pathnames relative to the current directory. very "stay in your lane" of it โจdiff.orderFileโ points at a file that tells Git how to order the files inside a diff. see the-Ooption to git-diff(1) for the deets. ifdiff.orderFileis a relative pathname, it gets treated as relative to the top of the working tree, iykyk ๐ธdiff.renameLimitโ how many files to consider in the exhaustive portion of copy/rename detection; same energy as thegit diffoption-l. if you don't set it, the default value is currently1000. this setting does nothing if rename detection is turned off, so don't come crying ๐ญdiff.renamesโ whether and how Git detects renames. set it tofalseand rename detection is fully disabled. set it totrueand you get basic rename detection. set it tocopiesorcopyand Git will detect copies too, periodt. defaults totrue. heads up though: this only affectsgit diffPorcelain like git-diff(1) and git-log(1), not lower level commands such as git-diff-files(1) ๐ซถdiff.suppressBlankEmptyโ a boolean that inhibits the standard behavior of printing a space before each empty output line. defaults tofalse.diff.submoduleโ picks the format for showing differences in submodules. theshortformat just shows the names of the commits at the beginning and end of the range. thelogformat lists the commits in the range like git-submodule(1)summarydoes. thediffformat shows an inline diff of the changed contents of the submodule. defaults toshort๐diff.wordRegexโ a POSIX Extended Regular Expression that decides what counts as a "word" when Git does word-by-word difference calculations. character sequences that match the regex are "words", and all other characters are ignorable whitespace. iconic honestly.diff.<driver>.commandโ the custom diff driver command. see gitattributes(5) for details.diff.<driver>.trustExitCodeโ if this boolean istrue, then thediff.<driver>.commandcommand is expected to return exit code0if it thinks the input files are equal, or1if it thinks they're different, like diff(1). if it'sfalse(which is the default, bestie), then the command is expected to return exit code0regardless of equality. any other exit code causes Git to report a fatal error ๐diff.<driver>.xfuncnameโ the regular expression the diff driver should use to recognize the hunk header. a built-in pattern may also be used. see gitattributes(5).diff.<driver>.binaryโ set this option totrueto make the diff driver treat files as binary. see gitattributes(5).diff.<driver>.textconvโ the command the diff driver should call to generate the text-converted version of a file. the result of the conversion is used to generate a human-readable diff. see gitattributes(5) ๐ฆdiff.<driver>.wordRegexโ the regular expression the diff driver should use to split words in a line. see gitattributes(5).diff.<driver>.cachetextconvโ set this totrueto make the diff driver cache the text conversion outputs. see gitattributes(5). caching? we love her ๐diff.indentHeuristicโ set this tofalseto disable the default heuristics that shift diff hunk boundaries to make patches easier to read.diff.algorithmโ picks a diff algorithm. the variants are:default,myersโ the basic greedy diff algorithm. currently, this is the default.minimalโ spend extra time to make sure the smallest possible diff is produced.patienceโ use the "patience diff" algorithm when generating patches.histogramโ this algorithm extends the patience algorithm to "support low-occurrence common elements".
diff.wsErrorHighlightโ highlights whitespace errors in thecontext,oldornewlines of the diff. multiple values are separated by comma,noneresets previous values,defaultresets the list tonew, andallis a shorthand forold,new,context. the whitespace errors are colored withcolor.diff.whitespace. the command line option--ws-error-highlight=<kind>overrides this setting, no cap ๐ฅdiff.colorMovedโ if you set it to either a valid<mode>or a true value, moved lines in a diff get colored differently. for the details of valid modes, see--color-movedin git-diff(1). if you just set it totrue, the default color mode gets used. when it'sfalse, moved lines are not colored.diff.colorMovedWSโ when moved lines are colored using, like, thediff.colorMovedsetting, this option controls the mode for how spaces are treated. for the details of valid modes see--color-moved-wsin git-diff(1).diff.toolโ controls which diff tool git-difftool(1) uses. this variable overrides the value configured inmerge.tool. the list below shows the valid built-in values, and any other value is treated as a custom diff tool, which requires that a correspondingdifftool.<tool>.cmdvariable is defined. slay.diff.guitoolโ controls which diff tool git-difftool(1) uses when the-g/--guiflag is specified. this variable overrides the value configured inmerge.guitool. the list below shows the valid built-in values, and any other value is treated as a custom diff tool, which requires that a correspondingdifftool.<guitool>.cmdvariable is defined โจ
the built-in tool list (applies to both, bestie) ๐
araxisโ use Araxis Merge (requires a graphical session)bcโ use Beyond Compare (requires a graphical session)bc3โ use Beyond Compare (requires a graphical session)bc4โ use Beyond Compare (requires a graphical session)codecompareโ use Code Compare (requires a graphical session)deltawalkerโ use DeltaWalker (requires a graphical session)diffmergeโ use DiffMerge (requires a graphical session)diffuseโ use Diffuse (requires a graphical session)ecmergeโ use ECMerge (requires a graphical session)emergeโ use Emacs' Emergeexamdiffโ use ExamDiff Pro (requires a graphical session)guiffyโ use Guiffyโs Diff Tool (requires a graphical session)gvimdiffโ use gVim (requires a graphical session)kdiff3โ use KDiff3 (requires a graphical session)kompareโ use Kompare (requires a graphical session)meldโ use Meld (requires a graphical session)nvimdiffโ use Neovimopendiffโ use FileMerge (requires a graphical session)p4mergeโ use HelixCore P4Merge (requires a graphical session)smergeโ use Sublime Merge (requires a graphical session)tkdiffโ use TkDiff (requires a graphical session)vimdiffโ use Vimvscodeโ use Visual Studio Code (requires a graphical session)winmergeโ use WinMerge (requires a graphical session)xxdiffโ use xxdiff (requires a graphical session)difftool.<tool>.cmdโ specifies the command to invoke the specified diff tool. the specified command is evaluated in shell with the following variables available:LOCALis set to the name of the temporary file containing the contents of the diff pre-image andREMOTEis set to the name of the temporary file containing the contents of the diff post-image. see the--tool=<tool>option in git-difftool(1) for more details ๐ซถdifftool.<tool>.pathโ overrides the path for the given tool. this is useful in case your tool is not in thePATH, because of course it isn't ๐difftool.trustExitCodeโ exit difftool if the invoked diff tool returns a non-zero exit status. see the--trust-exit-codeoption in git-difftool(1) for more details.difftool.promptโ prompt before each invocation of the diff tool.difftool.guiDefaultโ set it totrueto use thediff.guitoolby default (equivalent to specifying the--guiargument), orautoto selectdiff.guitoolordiff.tooldepending on the presence of aDISPLAYenvironment variable value. the default isfalse, where the--guiargument must be provided explicitly for thediff.guitoolto be used ๐
and now the extensions.* section, which is giving "advanced placement" energy ngl:
extensions.*โ unless otherwise stated, it is an error to specify an extension ifcore.repositoryFormatVersionis not1. see gitrepository-layout(5) โญcompatObjectFormatโ specify a compatibility hash algorithm to use. the acceptable values aresha1andsha256. the value specified must be different from the value ofextensions.objectFormat. this allows client level interoperability between git repositories whoseobjectFormatmatches thiscompatObjectFormat. in particular when fully implemented the pushes and pulls from a repository in whoseobjectFormatmatchescompatObjectFormat. as well as being able to use oids encoded incompatObjectFormatin addition to oids encoded withobjectFormatto locally specify objects.
note that the functionality enabled by this extension is incomplete and subject to change. it currently exists only to allow development and testing of the underlying feature and is not designed to be enabled by end users. so likeโฆ don't, bestie ๐ญ
noopโ this extension does not change gitโs behavior at all. it is useful only for testing format-1 compatibility. for historical reasons, this extension is respected regardless of thecore.repositoryFormatVersionsetting.noop-v1โ this extension does not change gitโs behavior at all. it is useful only for testing format-1 compatibility.objectFormatโ specify the hash algorithm to use. the acceptable values aresha1andsha256. if not specified,sha1is assumed.
note that this setting should only be set by git-init(1) or git-clone(1). trying to change it after initialization will not work and will produce hard-to-diagnose issues. for real, do not touch ๐
partialCloneโ when enabled, indicates that the repo was created with a partial clone (or later performed a partial fetch) and that the remote may have omitted sending certain unwanted objects. such a remote is called a "promisor remote" and it promises that all such omitted objects can be fetched from it in the future. the value of this key is the name of the promisor remote ๐
For historical reasons, this extension is respected regardless of the core.repositoryFormatVersion setting. (Yes, again. This family of extensions lowkey does not care about your format version era. ๐
)
preciousObjectsโ turn this on and it means the objects in the repo MUST NOT be deleted (like, bygit-pruneorgit repack -d). Precious. Literally in the name, bestie. Same deal as the others: for historical reasons, this extension is respected regardless of thecore.repositoryFormatVersionsetting.refStorageโ tells Git what ref storage format to use and a matching payload. The value is either a format name or a URI:- A format name on its own (e.g.
reftableorfiles). - A URI in the form
<format>://<payload>โ which explicitly says both the format and the payload (e.g.reftable:///foo/bar).
- A format name on its own (e.g.
The supported format names are:
filesโ for loose files withpacked-refs. This one is the default. ๐reftableโ for the reftable format.
The payload gets passed straight through to the reference backend. For the files and reftable backends, this has to be a filesystem path where the references will be stored โ and it defaults to the commondir when no payload is given. Relative paths get resolved relative to the $GIT_DIR. Future backends might support other payload schemes, e.g. postgres://127.0.0.1:5432?database=myrepo.
โ ๏ธ Heads up: this setting should only be set by git-init(1) or git-clone(1). Trying to change it after initialization will not work and will produce hard-to-diagnose issues. Like, please don't. ๐ญ
relativeWorktreesโ if enabled, it means at least one worktree has been linked with relative paths. It gets set automatically if a worktree has been created or repaired with either the--relative-pathsoption or with theworktree.useRelativePathsconfig set totrue. ๐ฆsubmodulePathConfigโ this extension exists for the minority of users who:- Hit errors like
refusing to create ...in another submodule's git dir, for a whole bunch of reasons โ like case-insensitive filesystem conflicts when you create modules namedfooandFoo. ๐ - Need more flexible submodule layouts, for example because nested names like
foo,foo/barandfoo/bazare not supported by the default gitdir mechanism (which uses.git/modules/<plain-name>locations), and that causes even more conflicts.
- Hit errors like
When extensions.submodulePathConfig is enabled, the submodule.<name>.gitdir config becomes the single source of truth for all submodule gitdir paths, and it's automatically set for all new submodules during both clone and init operations.
Git will error out if a module does not have a corresponding submodule.<name>.gitdir set. no cap.
Existing (pre-extension) submodules need to be migrated by adding the missing config entries. You can do this manually, e.g. for each submodule: git config submodule.<name>.gitdir .git/modules/<name>, or via the git submodule--helper migrate-gitdir-configs command, which iterates over all submodules and attempts to migrate them.
You can have the extension enabled automatically for new repositories by setting init.defaultSubmodulePathConfig to true โ for example, by running git config --global init.defaultSubmodulePathConfig true. โจ
worktreeConfigโ if enabled, then worktrees will load config settings from the$GIT_DIR/config.worktreefile in addition to the$GIT_COMMON_DIR/configfile. Note that$GIT_COMMON_DIRand$GIT_DIRare the same for the main working tree, while other working trees have$GIT_DIRequal to$GIT_COMMON_DIR/worktrees/<id>/. The settings in theconfig.worktreefile will override settings from any other config files. ๐
When you enable this extension, you must be careful to move certain values from the common config file to the main working tree's config.worktree file, if present:
core.worktreemust be moved from$GIT_COMMON_DIR/configto$GIT_COMMON_DIR/config.worktree.- If
core.bareistrue, then it must be moved from$GIT_COMMON_DIR/configto$GIT_COMMON_DIR/config.worktree.
It may also be beneficial to adjust the locations of core.sparseCheckout and core.sparseCheckoutCone depending on how much you want customizable sparse-checkout settings for each worktree. By default, the git sparse-checkout builtin enables this extension, assigns these config values on a per-worktree basis, and uses the $GIT_DIR/info/sparse-checkout file to specify the sparsity for each worktree independently. See git-sparse-checkout(1) for more details. ๐ธ
And yeah โ for historical reasons, this extension is respected regardless of the core.repositoryFormatVersion setting.
๐ fastimport.unpackLimit
If the number of objects imported by git-fast-import(1) is below this limit, then the objects will be unpacked into loose object files. But if the number of imported objects equals or exceeds this limit, then the pack will be stored as a pack. Storing the pack from a fast-import can make the import operation complete faster โ especially on slow filesystems. If it's not set, the value of transfer.unpackLimit is used instead.
โจ feature.*
The config settings that start with feature. modify the defaults of a group of other config settings. These groups are created by the Git developer community as recommended defaults and are subject to change. In particular, new config options may be added with different defaults. It's giving "curated vibes, moving target." ๐
๐งช feature.experimental
Enable config options that are new to Git and are being considered for future defaults. Config settings included here may be added or removed with each release โ including minor version updates. These settings may have unintended interactions since they're so new. Please enable this setting if you're interested in providing feedback on experimental features. The new default values are:
fetch.negotiationAlgorithm=skippingmay improve fetch negotiation times by skipping more commits at a time, reducing the number of round trips.pack.useBitmapBoundaryTraversal=truemay improve bitmap traversal times by walking fewer objects.pack.allowPackReuse=multimay improve the time it takes to create a pack by reusing objects from multiple packs instead of just one.pack.usePathWalkmay speed up packfile creation and make the packfiles significantly smaller in the presence of certain filename collisions with Git's default name-hash.init.defaultRefFormat=reftablecauses newly initialized repositories to use the reftable format for storing references. This new format solves issues with case-insensitive filesystems, compresses better, and performs significantly better with many use cases. Refer toDocumentation/technical/reftable.adocfor more information on this new storage format. ๐ฅ
๐๏ธ feature.manyFiles
Enable config options that optimize for repos with many files in the working directory. With many files, commands like git status and git checkout may be slow, and these new defaults improve performance:
index.skipHash=truespeeds up index writes by not computing a trailing checksum. Note that this will cause Git versions earlier than2.13.0to refuse to parse the index, and Git versions earlier than2.40.0will report a corrupted index duringgit fsck. ๐ so like, know your audience.index.version=4enables path-prefix compression in the index.core.untrackedCache=trueenables the untracked cache. This setting assumes thatmtimeis working on your machine. ๐ซถ
๐ fetch.recurseSubmodules
This option controls whether git fetch (and the underlying fetch in git pull) will recursively fetch into populated submodules. It can be set either to a boolean value or to on-demand. Setting it to a boolean changes the behavior of fetch and pull to recurse unconditionally into submodules when set to true, or to not recurse at all when set to false. When set to on-demand, fetch and pull will only recurse into a populated submodule when its superproject retrieves a commit that updates the submodule's reference. Defaults to on-demand, or to the value of submodule.recurse if set.
๐ fetch.fsckObjects
If it's set to true, git-fetch-pack will check all fetched objects. See transfer.fsckObjects for what's checked. Defaults to false. If not set, the value of transfer.fsckObjects is used instead.
๐ฉบ fetch.fsck.<msg-id>
Acts like fsck.<msg-id>, but is used by git-fetch-pack(1) instead of git-fsck(1). See the fsck.<msg-id> documentation for details.
๐ fetch.fsck.skipList
Acts like fsck.skipList, but is used by git-fetch-pack(1) instead of git-fsck(1). See the fsck.skipList documentation for details.
๐ฆ fetch.unpackLimit
If the number of objects fetched over the Git native transfer is below this limit, then the objects will be unpacked into loose object files. However, if the number of received objects equals or exceeds this limit, then the received pack will be stored as a pack โ after adding any missing delta bases. Storing the pack from a push can make the push operation complete faster, especially on slow filesystems. If not set, the value of transfer.unpackLimit is used instead.
๐งน fetch.prune
If true, fetch will automatically behave as if the --prune option was given on the command line. See also remote.<name>.prune and the PRUNING section of git-fetch(1).
๐ท๏ธ fetch.pruneTags
If true, fetch will automatically behave as if the refs/tags/*:refs/tags/* refspec was provided when pruning โ if it's not set already. This lets you set both this option and fetch.prune to maintain a 1=1 mapping to upstream refs. See also remote.<name>.pruneTags and the PRUNING section of git-fetch(1). ๐
๐ fetch.all
If true, fetch will attempt to update all available remotes. This behavior can be overridden by passing --no-all or by explicitly specifying one or more remote(s) to fetch from. Defaults to false.
๐จ๏ธ fetch.output
Controls how ref update status is printed. Valid values are full and compact. Default value is full. See the OUTPUT section in git-fetch(1) for details. โจ
fetch.negotiationAlgorithm
Okay so this one controls how info about the commits in ur local repo gets sent over when Git is negotiating what goes in the packfile that the server's gonna send u ๐ซถ. Set it to consecutive to use an algorithm that walks over consecutive commits and checks each one. Set it to skipping to use one that skips commits so it converges faster โ but heads up, that may give u a larger-than-necessary packfile ๐ญ. Or set it to noop to not send any information at all, which will almost certainly result in a larger-than-necessary packfile, but it does skip the negotiation step entirely. Set it to default to override settings u made previously and just use the default behaviour. The default is normally consecutive, but if feature.experimental is true then the default is skipping. Unknown values will cause git fetch to error out, no cap ๐.
See also the --negotiate-only and --negotiation-restrict options to git-fetch(1).
fetch.showForcedUpdates
Set to false to enable --no-show-forced-updates in git-fetch(1) and git-pull(1) commands. Defaults to true. Simple as that โจ
fetch.parallel
Specifies the maximal number of fetch operations to be run in parallel at a time (that's submodules, or remotes when the --multiple option of git-fetch(1) is in effect) ๐ฅ
A value of 0 will give u some reasonable default. If unset, it defaults to 1.
For submodules, this setting can be overridden using the submodule.fetchJobs config setting.
fetch.writeCommitGraph
Set to true to write a commit-graph after every git fetch command that downloads a pack-file from a remote. Using the --split option, most executions will create a very small commit-graph file on top of the existing commit-graph file(s). Occasionally these files will merge and the write may take longer. Having an updated commit-graph file helps performance of many Git commands, including git merge-base, git push -f, and git log --graph. Defaults to false. It's giving "small effort, big glow-up" ๐
fetch.bundleURI
This value stores a URI for downloading Git object data from a bundle URI before performing an incremental fetch from the origin Git server. This is similar to how the --bundle-uri option behaves in git-clone(1). git clone --bundle-uri will set the fetch.bundleURI value if the supplied bundle URI contains a bundle list that's organized for incremental fetches ๐
If u modify this value and ur repository has a fetch.bundleCreationToken value, then remove that fetch.bundleCreationToken value before fetching from the new bundle URI. Don't skip that step bestie ๐
fetch.bundleCreationToken
When using fetch.bundleURI to fetch incrementally from a bundle list that uses the "creationToken" heuristic, this config value stores the maximum creationToken value of the downloaded bundles. This value is used to prevent downloading bundles in the future if the advertised creationToken is not strictly larger than this value ๐
The creation token values are chosen by the provider serving the specific bundle URI. If u modify the URI at fetch.bundleURI, then be sure to remove the value for the fetch.bundleCreationToken value before fetching.
fetch.followRemoteHEAD
When fetching using a default refspec, this setting determines how to handle differences between a fetched remote's HEAD and the local remotes/<name>/HEAD symbolic-ref. Its value is one of:
createโ createremotes/<name>/HEADif a ref exists on the remote, but not locally. An existing symbolic-ref will not be touched. This is the default value.warnโ display a warning if the remote advertises a differentHEADthan what's set locally. Behaves like"create"if the local symbolic-ref doesn't exist.alwaysโ silently updateremotes/<name>/HEADwhenever the remote advertises a new value.neverโ never create or modify theremotes/<name>/HEADsymbolic-ref.
filter.<driver>.clean
The command which is used to convert the content of a worktree file to a blob upon checkin. See gitattributes(5) for details ๐ฆ
filter.<driver>.smudge
The command which is used to convert the content of a blob object to a worktree file upon checkout. See gitattributes(5) for details ๐ฆ
format.attach
Enable multipart/mixed attachments as the default for format-patch. The value can also be a double quoted string, which will enable attachments as the default and set the value as the boundary. See the --attach option in git-format-patch(1). To countermand an earlier value, set it to an empty string ๐ธ
format.from
Provides the default value for the --from option to format-patch. Accepts a boolean value, or a name and email address. If false, format-patch defaults to --no-from, using commit authors directly in the "From:" field of patch mails. If true, format-patch defaults to --from, using ur committer identity in the "From:" field of patch mails and including a "From:" field in the body of the patch mail if different. If set to a non-boolean value, format-patch uses that value instead of ur committer identity. Defaults to false.
format.forceInBodyFrom
Provides the default value for the --[no-]force-in-body-from option to format-patch. Defaults to false.
format.numbered
A boolean which can enable or disable sequence numbers in patch subjects. It defaults to "auto", which enables it only if there's more than one patch. It can be enabled or disabled for all messages by setting it to "true" or "false". See the --numbered option in git-format-patch(1).
format.headers
Additional email headers to include in a patch to be submitted by mail. See git-format-patch(1) โจ
format.to, format.cc
Additional recipients to include in a patch to be submitted by mail. See the --to and --cc options in git-format-patch(1).
format.subjectPrefix
The default for format-patch is to output files with the [PATCH] subject prefix. Use this variable to change that prefix ๐
format.coverFromDescription
The default mode for format-patch to determine which parts of the cover letter will be populated using the branch's description. See the --cover-from-description option in git-format-patch(1).
format.signature
The default for format-patch is to output a signature containing the Git version number. Use this variable to change that default. Set this variable to the empty string ("") to suppress signature generation ๐
โโ๏ธ
format.signatureFile
Works just like format.signature except the contents of the file specified by this variable will be used as the signature.
format.suffix
The default for format-patch is to output files with the suffix .patch. Use this variable to change that suffix (make sure to include the dot if u want it, bestie ๐).
format.encodeEmailHeaders
Encode email headers that have non-ASCII characters with "Q-encoding" (described in RFC 2047) for email transmission. Defaults to true.
format.pretty
The default pretty format for log/show/whatchanged command. See git-log(1), git-show(1), git-whatchanged(1).
format.thread
The default threading style for git format-patch. Can be a boolean value, or shallow or deep. shallow threading makes every mail a reply to the head of the series, where the head is chosen from the cover letter, the --in-reply-to, and the first patch mail, in this order. deep threading makes every mail a reply to the previous one. A true boolean value is the same as shallow, and a false value disables threading ๐งต
format.signOff
A boolean value which lets u enable the -s/--signoff option of format-patch by default.
Note: adding theSigned-off-bytrailer to a patch should be a conscious act and means that u certify u have the rights to submit this work under the same open source license. Please see theSubmittingPatchesdocument for further discussion. Like, actually read it, it's a whole legal vibe check โ๏ธ
format.coverLetter
A boolean that controls whether to generate a cover-letter when format-patch is invoked, but in addition can be set to "auto", to generate a cover-letter only when there's more than one patch. Default is false.
format.commitListFormat
When the --commit-list-format option is not given, format-patch uses the value of this variable to decide how to format the entry of each commit. Defaults to shortlog.
format.outputDirectory
Set a custom directory to store the resulting files instead of the current working directory. All directory components will be created ๐
format.filenameMaxLength
The maximum length of the output filenames generated by the format-patch command; defaults to 64. Can be overridden by the --filename-max-length=<n> command line option.
format.useAutoBase
A boolean value which lets u enable the --base=auto option of format-patch by default. Can also be set to "whenAble" to allow enabling --base=auto if a suitable base is available, but to skip adding base info otherwise without the format dying ๐
format.notes
Provides the default value for the --notes option to format-patch. Accepts a boolean value, or a ref which specifies where to get notes. If false, format-patch defaults to --no-notes. If true, format-patch defaults to --notes. If set to a non-boolean value, format-patch defaults to --notes=<ref>, where ref is the non-boolean value. Defaults to false.
If u wish to use the ref refs/notes/true, please use that literal instead ๐
This configuration can be specified multiple times in order to allow multiple notes refs to be included. In that case, it will behave similarly to multiple --[no-]notes[=] options passed in. That is, a value of true will show the default notes, a value of <ref> will also show notes from that notes ref, and a value of false will negate previous configurations and not show notes.
For example,
[format]
notes = true
notes = foo
notes = false
notes = bar
will only show notes from refs/notes/bar. Order matters, icon behaviour ๐ซถ
format.mboxrd
A boolean value which enables the robust "mboxrd" format when --stdout is in use to escape "^>+From " lines. Escaping queen ๐
format.noprefixโ okay so if this is set, you wonโt see any source or destination prefix in patches. Itโs equivalent to thediff.noprefixoption used bygit diff(but which is not respected byformat-patch). Heads up, bestie: by setting this, the receiver of any patches you generate will have to apply them using the-p0option. ๐fsck.<msg-id>โ so during fsck, Git may find issues with legacy data that wouldnโt be generated by current versions of Git, and that wouldnโt be sent over the wire iftransfer.fsckObjectswas set. This feature is intended to support working with legacy repositories containing such data. โจ Settingfsck.<msg-id>will be picked up bygit-fsck(1), but to accept pushes of such data setreceive.fsck.<msg-id>instead, or to clone or fetch it setfetch.fsck.<msg-id>. The rest of the documentation discussesfsck.*for brevity, but the same applies for the correspondingreceive.fsck.*andfetch.fsck.*variables. Unlike variables likecolor.uiandcore.editor, thereceive.fsck.<msg-id>andfetch.fsck.<msg-id>variables will not fall back on thefsck.<msg-id>configuration if they arenโt set. To uniformly configure the same fsck settings in different circumstances, all three of them must be set to the same values. No cap. Whenfsck.<msg-id>is set, errors can be switched to warnings and vice versa by configuring thefsck.<msg-id>setting where the<msg-id>is the fsck message ID and the value is one oferror,warnorignore. For convenience, fsck prefixes the error/warning with the message ID, e.g.missingEmail: invalid author/committer line - missing emailmeans that settingfsck.missingEmail = ignorewill hide that issue. In general, it is better to enumerate existing objects with problems withfsck.skipList, instead of listing the kind of breakages these problematic objects share to be ignored, as doing the latter will allow new instances of the same breakages go unnoticed. Setting an unknownfsck.<msg-id>value will cause fsck to die, but doing the same forreceive.fsck.<msg-id>andfetch.fsck.<msg-id>will only cause git to warn. See the Fsck Messages section ofgit-fsck(1)for supported values of<msg-id>. ๐fsck.skipListโ the path to a list of object names (i.e. one unabbreviated SHA-1 per line) that are known to be broken in a non-fatal way and should be ignored. On versions of Git 2.20 and later, comments (#), empty lines, and any leading and trailing whitespace are ignored. Everything but a SHA-1 per line will error out on older versions. This feature is useful when an established project should be accepted despite early commits containing errors that can be safely ignored, such as invalid committer email addresses. Note: corrupt objects cannot be skipped with this setting. Likefsck.<msg-id>this variable has correspondingreceive.fsck.skipListandfetch.fsck.skipListvariants. Unlike variables likecolor.uiandcore.editorthereceive.fsck.skipListandfetch.fsck.skipListvariables will not fall back on thefsck.skipListconfiguration if they arenโt set. To uniformly configure the same fsck settings in different circumstances, all three of them must be set to the same values. Okay, lore time: older versions of Git (before 2.20) documented that the object names list should be sorted. This was never a requirement; the object names could appear in any order, but when reading the list we tracked whether the list was sorted for the purposes of an internal binary search implementation, which could save itself some work with an already sorted list. Unless you had a humongous list there was no reason to go out of your way to pre-sort the list. After Git version 2.20 a hash implementation is used instead, so thereโs now no reason to pre-sort the list. Slay, efficiency.fsmonitor.allowRemoteโ by default, the fsmonitor daemon refuses to work with network-mounted repositories. Settingfsmonitor.allowRemotetotrueoverrides this behavior. Only respected whencore.fsmonitoris set totrue. ๐fsmonitor.socketDirโ this Mac OS and Linux-specific option, if set, specifies the directory in which to create the Unix domain socket used for communication between the fsmonitor daemon and various Git commands. The directory must reside on a native filesystem. Only respected whencore.fsmonitoris set totrue. โจgc.aggressiveDepthโ the depth parameter used in the delta compression algorithm used bygit gc --aggressive. This defaults to50, which is the default for the--depthoption when--aggressiveisnโt in use. See the documentation for the--depthoption ingit-repack(1)for more details. ๐ฑgc.aggressiveWindowโ the window size parameter used in the delta compression algorithm used bygit gc --aggressive. This defaults to250, which is a much more aggressive window size than the default--windowof10. See the documentation for the--windowoption ingit-repack(1)for more details. ๐ฅgc.autoโ when there are approximately more than this many loose objects in the repository,git gc --autowill pack them. Some Porcelain commands use this command to perform a light-weight garbage collection from time to time. The default value is6700. Setting this to0disables not only automatic packing based on the number of loose objects, but also any other heuristicgit gc --autowill otherwise use to determine if thereโs work to do, such asgc.autoPackLimit. ๐gc.autoPackLimitโ when there are more than this many packs that are not marked with*.keepfile in the repository,git gc --autoconsolidates them into one larger pack. The default value is50. Setting this to0disables it. Settinggc.autoto0will also disable this. See thegc.bigPackThresholdconfiguration variable below. When in use, itโll affect how the auto pack limit works. ๐gc.autoDetachโ makegit gc --autoreturn immediately and run in the background if the system supports it. Default istrue. This config variable acts as a fallback in casemaintenance.autoDetachis not set. โจgc.bigPackThresholdโ if non-zero, all non-cruft packs larger than this limit are kept whengit gcis run. This is very similar to--keep-largest-packexcept that all non-cruft packs that meet the threshold are kept, not just the largest pack. Defaults to zero. Common unit suffixes ofk,m, orgare supported. Note that if the number of kept packs is more thangc.autoPackLimit, this configuration variable is ignored, all packs except the base pack will be repacked. After this the number of packs should go belowgc.autoPackLimitandgc.bigPackThresholdshould be respected again. If the amount of memory estimated forgit repackto run smoothly is not available andgc.bigPackThresholdis not set, the largest pack will also be excluded (this is the equivalent of runninggit gcwith--keep-largest-pack). Big pack energy.gc.writeCommitGraphโ iftrue, then gc will rewrite the commit-graph file whengit-gc(1)is run. When usinggit gc --autothe commit-graph will be updated if housekeeping is required. Default istrue. Seegit-commit-graph(1)for details. ๐ซถgc.logExpiryโ if the filegc.logexists, thengit gc --autowill print its content and exit with status zero instead of running unless that file is more thangc.logExpiryold. Default is"1.day". Seegc.pruneExpirefor more ways to specify its value. ๐gc.packRefsโ runninggit pack-refsin a repository renders it unclonable by Git versions prior to1.5.1.2over dumb transports such as HTTP. This variable determines whethergit gcrunsgit pack-refs. This can be set tonotbareto enable it within all non-bare repos or it can be set to a boolean value. The default istrue. ๐gc.cruftPacksโ store unreachable objects in a cruft pack (seegit-repack(1)) instead of as loose objects. The default istrue. ๐งgc.maxCruftSizeโ limit the size of new cruft packs when repacking. When specified in addition to--max-cruft-size, the command line option takes priority. See the--max-cruft-sizeoption ofgit-repack(1). โจgc.pruneExpireโ whengit gcis run, it will callprune --expire 2.weeks.ago(andrepack --cruft --cruft-expiration 2.weeks.agoif using cruft packs viagc.cruftPacksor--cruft). Override the grace period with this config variable. The value"now"may be used to disable this grace period and always prune unreachable objects immediately, or"never"may be used to suppress pruning. This feature helps prevent corruption whengit gcruns concurrently with another process writing to the repository; see the NOTES section ofgit-gc(1). Important tea โgc.worktreePruneExpireโ whengit gcis run, it callsgit worktree prune --expire 3.months.ago. This config variable can be used to set a different grace period. The value"now"may be used to disable the grace period and prune$GIT_DIR/worktreesimmediately, or"never"may be used to suppress pruning. ๐gc.reflogExpire,gc.<pattern>.reflogExpireโgit reflog expireremoves reflog entries older than this time; defaults to 90 days. The value"now"expires all entries immediately, and"never"suppresses expiration altogether. With<pattern>(e.g."refs/stash") in the middle the setting applies only to the refs that match the<pattern>. ๐gc.reflogExpireUnreachable,gc.<pattern>.reflogExpireUnreachableโgit reflog expireremoves reflog entries older than this time and are not reachable from the current tip; defaults to 30 days. The value"now"expires all entries immediately, and"never"suppresses expiration altogether. With<pattern>(e.g."refs/stash") in the middle, the setting applies only to the refs that match the<pattern>. These types of entries are generally created as a result of usinggit commit --amendorgit rebaseand are the commits prior to the amend or rebase occurring. Since these changes are not part of the current project most users will want to expire them sooner, which is why the default is more aggressive thangc.reflogExpire. Reflog cleanup era โจ
๐ง gc.recentObjectsHook
Okay so when Git is deciding whether to yeet an object (either while cooking up a cruft pack or while stashing unreachable objects as loose ones), it can run your specified command(s) through the shell first. Interpret whatever they print as object IDs that Git treats as "recent", no matter how ancient they actually are. By pretending their mtimes are "now", any objects (and their descendants) mentioned in the output get kept, regardless of their true age. ๐ซถ
Output must be exactly one hex object ID per line, and nothing else. Objects that can't be found in the repository are just ignored. Multiple hooks are supported, but all of them must exit successfully โ otherwise the whole operation (generating a cruft pack or unpacking unreachable objects) gets halted. ๐
๐ gc.repackFilter
When repacking, use the specified filter to move certain objects into a separate packfile. See the --filter=<filter-spec> option of git-repack(1).
๐ธ gc.repackFilterTo
When repacking and using a filter (see gc.repackFilter), the specified location is where the packfile containing the filtered-out objects gets created.
โ ๏ธ WARNING: that specified location should be accessible โ using the Git alternates mechanism, for example โ otherwise the repo could be considered corrupt by Git, since it might not be able to access the objects in that packfile. See the--filter-to=<dir>option of git-repack(1) and theobjects/info/alternatessection of gitrepository-layout(5).
๐ฆ gc.rerereResolved
Records of conflicted merges you resolved earlier are kept for this many days when git rerere gc runs. You can also use more human-readable stuff like "1.month.ago", etc. The default is 60 days. See git-rerere(1). โจ
๐
gc.rerereUnresolved
Records of conflicted merges you have not resolved are kept for this many days when git rerere gc runs. You can also use more human-readable stuff like "1.month.ago", etc. The default is 15 days. See git-rerere(1).
๐ gitcvs.commitMsgAnnotation
Append this string to each commit message. Set it to the empty string to disable the feature entirely. Defaults to "via git-CVS emulator".
โญ gitcvs.enabled
Whether the CVS server interface is enabled for this repository. See git-cvsserver(1).
๐ gitcvs.logFile
Path to a log file where the CVS server interface well... logs various stuff. See git-cvsserver(1). ๐ญ
๐ gitcvs.usecrlfattr
If true, the server looks up the end-of-line conversion attributes for files to figure out which -k modes to use. If the attributes force Git to treat a file as text, the -k mode gets left blank so CVS clients treat it as text. If they suppress text conversion, the file gets set with -kb mode, which suppresses any newline munging the client might otherwise do. If the attributes don't allow the file type to be determined, then gitcvs.allBinary is used. See gitattributes(5).
๐ฅ gitcvs.allBinary
This kicks in if gitcvs.usecrlfattr doesn't resolve the correct -kb mode to use. If true, all unresolved files get sent to the client in mode -kb โ which makes the client treat them as binary files, suppressing any newline munging it otherwise might do. Alternatively, if it's set to "guess", then the contents of the file are examined to decide if it's binary, similar to core.autocrlf.
๐ gitcvs.dbName
The database used by git-cvsserver to cache revision information derived from the Git repository. The exact meaning depends on the database driver in use โ for SQLite (which is the default driver) this is a filename. Supports variable substitution (see git-cvsserver(1) for details). May not contain semicolons (;). Default: %Ggitcvs.%m.sqlite
๐ง gitcvs.dbDriver
The Perl DBI driver used. You can specify any available driver here, but it might not work. git-cvsserver is tested with DBD::SQLite, reported to work with DBD::Pg, and reported not to work with DBD::mysql. Experimental feature. May not contain double colons (:). Default: SQLite. See git-cvsserver(1).
๐ซถ gitcvs.dbUser, gitcvs.dbPass
Database user and password. Only useful if you're setting gitcvs.dbDriver, since SQLite has no concept of database users and/or passwords. gitcvs.dbUser supports variable substitution (see git-cvsserver(1) for details).
๐ธ gitcvs.dbTableNamePrefix
Database table name prefix. Prepend it to the names of any database tables used, which lets a single database serve several repositories. Supports variable substitution (see git-cvsserver(1) for details). Any non-alphabetic characters get replaced with underscores.
Okay bestie, important footnote moment: All gitcvs variables except for gitcvs.usecrlfattr and gitcvs.allBinary can also be specified as gitcvs.<access_method>.<varname> (where access_method is one of "ext" and "pserver") to make them apply only for that given access method. ๐
๐ gitweb.category, gitweb.description, gitweb.owner, gitweb.url
See gitweb(1) for description.
๐ gitweb.avatar, gitweb.blame, gitweb.grep, gitweb.highlight, gitweb.patches, gitweb.pickaxe, gitweb.remote_heads, gitweb.showSizes, gitweb.snapshot
See gitweb.conf(5) for description.
๐ gpg.program
Pathname of the program to use instead of "gpg" when making or verifying a PGP signature. The program must support the same command-line interface as GPG, namely: to verify a detached signature, gpg --verify $signature - <$file is run, and the program is expected to signal a good signature by exiting with code 0. To generate an ASCII-armored detached signature, the standard input of gpg -bsau $key is fed with the contents to be signed, and the program is expected to send the result to its standard output. โจ
๐ฆ gpg.format
Specifies which key format to use when signing with --gpg-sign. Default is "openpgp". Other possible values are "x509", "ssh".
See gitformat-signature(5) for the signature format, which differs based on the selected gpg.format.
๐ gpg.<format>.program
Use this to customize the program used for the signing format you chose (see gpg.program and gpg.format). gpg.program can still be used as a legacy synonym for gpg.openpgp.program. The default value for gpg.x509.program is "gpgsm" and for gpg.ssh.program is "ssh-keygen".
โญ gpg.minTrustLevel
Specifies a minimum trust level for signature verification. If this option is unset, then signature verification for merge operations requires a key with at least marginal trust. Other operations that perform signature verification require a key with at least undefined trust. Setting this option overrides the required trust-level for all operations. Supported values, in increasing order of significance:
undefinednevermarginalfullyultimate
๐ gpg.ssh.defaultKeyCommand
This command gets run when user.signingkey is not set and an ssh signature is requested. On successful exit, a valid ssh public key prefixed with key:: is expected in the first line of its output. This allows for a script doing a dynamic lookup of the correct public key when it's impractical to statically configure user.signingKey โ for example when keys or SSH Certificates are rotated frequently, or when picking the right key depends on external factors unknown to git. ๐ญ
๐
gpg.ssh.allowedSignersFile
A file containing ssh public keys you're willing to trust. It consists of one or more lines of principals followed by an ssh public key, e.g.:
user1@example.com,user2@example.com ssh-rsa AAAAX1...
See ssh-keygen(1) "ALLOWED SIGNERS" for details. The principal is only used to identify the key and is available when verifying a signature.
SSH has no concept of trust levels like gpg does. To be able to differentiate between valid signatures and trusted signatures, the trust level of a signature verification is set to fully when the public key is present in the allowedSignersFile. Otherwise the trust level is undefined and git verify-commit/tag will fail. ๐
This file can be set to a location outside of the repository, and every developer maintains their own trust store. A central repository server could generate this file automatically from ssh keys with push access, to verify the code against. In a corporate setting this file is probably generated at a global location from automation that already handles developer ssh keys.
A repository that only allows signed commits can store the file in the repository itself using a path relative to the top-level of the working tree. This way only committers with an already valid key can add or change keys in the keyring. ๐๏ธ
Since OpensSSH 8.8 this file allows specifying a key lifetime using valid-after & valid-before options. Git will mark signatures as valid if the signing key was valid at the time of the signature's creation. This allows users to change a signing key without invalidating all previously made signatures.
Using a SSH CA key with the cert-authority option (see ssh-keygen(1) "CERTIFICATES") is also valid. ๐ง
๐ธ gpg.ssh.revocationFile
Either a SSH KRL or a list of revoked public keys (without the principal prefix). See ssh-keygen(1) for details. If a public key is found in this file then it will always be treated as having trust level "never" and signatures will show as invalid. ๐ซ
๐ grep.lineNumber
If set to true, enable -n option by default.
๐ grep.column
If set to true, enable the --column option by default.
โญ grep.patternType
Sets the default matching behavior. Using a value of basic, extended, fixed, or perl will enable the --basic-regexp, --extended-regexp, --fixed-strings, or --perl-regexp option accordingly, while the value default will use the grep.extendedRegexp option to choose between basic and extended.
๐ grep.extendedRegexp
If set to true, enable the --extended-regexp option by default. This option is ignored when the grep.patternType option is set to a value other than default.
๐ฆ grep.threads
Number of grep worker threads to use. If unset (or set to 0), Git will use as many threads as the number of logical cores available. ๐
๐ grep.fullName
If set to true, enable the --full-name option by default.
๐ grep.fallbackToNoIndex
If set to true, fall back to git grep --no-index if git grep is executed outside of a git repository. Defaults to false.
gui.commitMsgWidthโ sets how wide that commit message window is ingit-gui(1). The default is"75". slay, standard width ๐gui.diffContextโ tellsgit-gui(1)how many context lines to use when it calls diff. Default is"5". no cap, five lines of context around the goods ๐gui.displayUntrackedโ decides whethergit-gui(1)shows untracked files in the file list. Default is"true". yes bestie we do want to see the chaos ๐ธgui.encodingโ the default character encoding for displaying file contents ingit-gui(1)andgitk(1). It can be overridden by setting theencodingattribute for relevant files (seegitattributes(5)). If this option is not set, the tools default to the locale encoding. iykyk โจgui.matchTrackingBranchโ determines if new branches made withgit-gui(1)should default to tracking remote branches with matching names or not. Default:"false". lowkey conservative and that's valid ๐ฆgui.newBranchTemplateโ used as a suggested name when you create new branches usinggit-gui(1). it's giving "helpful little prefill" ๐gui.pruneDuringFetchโ"true"ifgit-gui(1)should prune remote-tracking branches when performing a fetch. The default value is"false". ๐งนgui.trustmtimeโ determines ifgit-gui(1)should trust the file modification timestamp or not. By default the timestamps are not trusted. trust issues, honestly valid ๐gui.spellingDictionaryโ the dictionary used for spell checking commit messages ingit-gui(1). When set to"none"spell checking is turned off. goodbye spellcheck era ๐ญgui.fastCopyBlameโ if true,git gui blameuses-Cinstead of-C -Cfor original location detection. It makes blame significantly faster on huge repositories at the expense of less thorough copy detection. speed vs thoroughness, the eternal vibe check ๐ฅgui.copyBlameThresholdโ the threshold to use ingit gui blameoriginal location detection, measured in alphanumeric characters. See thegit-blame(1)manual for more information on copy detection. ๐gui.blamehistoryctxโ the radius of history context in days to show ingitk(1)for the selected commit, when the Show History Context menu item is invoked fromgit gui blame. If this variable is set to zero, the whole history is shown. zero = full lore dump ๐gui.GCWarningโ determines whethergit-gui(1)should prompt for garbage collection when git detects a large number of loose objects in the repository. The default value is"true". it's giving "hey bestie, time to tidy" โญguitool.<name>.cmdโ the shell command line to execute when the corresponding item of thegit-gui(1)Tools menu is invoked. This option is mandatory for every tool. The command is executed from the root of the working directory, and in the environment it receives the name of the tool asGIT_GUITOOL, the name of the currently selected file asFILENAME, and the name of the current branch asCUR_BRANCH(if the head is detached,CUR_BRANCHis empty). the way it just hands you the whole context ๐ซถguitool.<name>.needsFileโ run the tool only if a diff is selected in the GUI. It guarantees thatFILENAMEis not empty. no diff, no run, periodt ๐guitool.<name>.noConsoleโ run the command silently, without creating a window to display its output. stealth mode activated ๐งguitool.<name>.noRescanโ don't rescan the working directory for changes after the tool finishes execution. moving on immediately, iconic ๐guitool.<name>.confirmโ show a confirmation dialog before actually running the tool. are you sure bestie ๐guitool.<name>.argPromptโ request a string argument from the user, and pass it to the tool through theARGSenvironment variable. Since requesting an argument implies confirmation, theconfirmoption has no effect if this is enabled. If the option is set totrue,yes, or1, the dialog uses a built-in generic prompt; otherwise the exact value of the variable is used. ๐guitool.<name>.revPromptโ request a single valid revision from the user, and set theREVISIONenvironment variable. In other aspects this option is similar toargPrompt, and can be used together with it. duo combo, love that for you โจguitool.<name>.revUnmergedโ show only unmerged branches in therevPromptsubdialog. This is useful for tools similar to merge or rebase, but not for things like checkout or reset. know the difference bestie ๐guitool.<name>.titleโ the title to use for the prompt dialog. The default is the tool name. ๐ธguitool.<name>.promptโ the general prompt string to display at the top of the dialog, before subsections forargPromptandrevPrompt. The default value includes the actual command. showing your work, we stan ๐help.browserโ specify the browser that will be used to display help in the web format. Seegit-help(1). ๐ฆhelp.formatโ override the default help format used bygit-help(1). Valuesman,info,webandhtmlare supported.manis the default.webandhtmlare the same. pick your fighter ๐help.autoCorrectโ if git detects typos and can identify exactly one valid command similar to the error, git will try to suggest the correct command or even run the suggestion automatically. Possible config values are:0,"false","off","no","show": show the suggested command (default). ๐1,"true","on","yes","immediate": run the suggested command immediately. ๐ฅ- positive number > 1: run the suggested command after specified deciseconds (0.1 sec). โฑ๏ธ
"never": don't run or show any suggested command. ๐"prompt": show the suggestion and prompt for confirmation to run the command. ๐
help.htmlPathโ specify the path where the HTML documentation resides. File system paths and URLs are supported. HTML pages will be prefixed with this path when help is displayed in the web format. This defaults to the documentation path of your Git installation. ๐hook.<friendly-name>.commandโ the command to execute forhook.<friendly-name>.<friendly-name>is a unique name that identifies this hook. The hook events that trigger the command are configured withhook.<friendly-name>.event. The value can be an executable path or a shell oneliner. If more than one value is specified for the same<friendly-name>, only the last value parsed is used. Seegit-hook(1). last one wins, no cap ๐ญhook.<friendly-name>.eventโ the hook events that triggerhook.<friendly-name>. The value is the name of a hook event, like"pre-commit"or"update". (Seegithooks(5)for a complete list of hook events.) On the specified event, the associatedhook.<friendly-name>.commandis executed. This is a multi-valued key. To runhook.<friendly-name>on multiple events, specify the key more than once. An empty value resets the list of events, clearing any previously defined events forhook.<friendly-name>. Seegit-hook(1).
The <friendly-name> must not be the same as a known hook event name (e.g. do not use hook.pre-commit.event). Using a known event name as a friendly-name is a fatal error because it creates an ambiguity with hook.<event>.enabled and hook.<event>.jobs. For unknown event names, a warning is issued when <friendly-name> matches the event value. โ ๏ธ
hook.<friendly-name>.enabledโ whether the hookhook.<friendly-name>is enabled. Defaults to true. Set to false to disable the hook without removing its configuration. This is particularly useful when a hook is defined in a system or global config file and needs to be disabled for a specific repository. Seegit-hook(1). off switch without the delete, we love an undo ๐ซถhook.<friendly-name>.parallelโ whether the hookhook.<friendly-name>may run in parallel with other hooks for the same event. Defaults to false. Set to true only when the hook script is safe to run concurrently with other hooks for the same event. If any hook for an event does not have this set to true, all hooks for that event run sequentially regardless ofhook.jobs. Only configured (named) hooks need to declare this. Traditional hooks found in the hooks directory do not need to, and run in parallel when the effective job count is greater than 1. Seegit-hook(1). one cautious friend ruins the parallel party ๐hook.<event>.enabledโ switch to enable or disable all hooks for the<event>hook event. When set to false, no hooks fire for that event, regardless of any per-hookhook.<friendly-name>.enabledsettings. Defaults to true. Seegit-hook(1).
Note on naming: <event> must be the event name (e.g. pre-commit), not a hook friendly-name. Since using a known event name as a friendly-name is disallowed (see hook.<friendly-name>.event above), there is no ambiguity between event-level and per-hook .enabled settings for known events. For unknown events, if a friendly-name matches the event name despite the warning, .enabled is treated as per-hook only. ๐ง
hook.<event>.jobsโ specifies how many hooks can be run simultaneously for the<event>hook event (e.g.hook.post-receive.jobs = 4). Overrideshook.jobsfor this specific event. The same parallelism restrictions apply: this setting has no effect unless all configured hooks for the event havehook.<friendly-name>.parallelset to true. Set to-1to use the number of available CPU cores. Must be a positive integer or-1; zero is rejected with a warning. Seegit-hook(1).
Note on naming: although this key resembles hook.<friendly-name>.* (a per-hook setting), <event> must be the event name, not a hook friendly name. The key component is stored literally and looked up by event name at runtime with no translation between the two namespaces. A key like hook.my-hook.jobs is stored under "my-hook" but the lookup at runtime uses the event name (e.g. "post-receive"), so hook.my-hook.jobs is silently ignored even when my-hook is registered for that event. Use hook.post-receive.jobs or any other valid event name when setting hook.<event>.jobs. ๐ this one will gaslight you if you're not careful
hook.jobsโ specifies how many hooks can be run simultaneously during parallelized hook execution. If unspecified, defaults to1(serial execution). Set to-1to use the number of available CPU cores. Can be overridden on a per-event basis withhook.<event>.jobs. Some hooks always run sequentially regardless of this setting because they operate on shared data and cannot safely be parallelized:applypatch-msg,prepare-commit-msg,commit-msgโ Receive a commit message file and may rewrite it in place. โ๏ธpre-commit,post-checkout,push-to-checkout,post-commitโ Access the working tree, index, or repository state. ๐ณ
This setting has no effect unless all configured hooks for the event have hook.<friendly-name>.parallel set to true. ๐
So like, for pre-push hooks โ which normally keep stdout and stderr separate โ setting this to a value greater than 1 (or just passing -j) will merge stdout into stderr so parallel output gets de-interleaved correctly. Slay.
๐ the http.* family (yes we're doing all of them) ๐
http.proxyโ Overrides the HTTP proxy. Normally this is set up via thehttp_proxy,https_proxy, andall_proxyenvironment variables (peepcurl(1)for the deets). And here's the cute part: on top of the syntax curl already gets, you can hand it a proxy string with a user name but no password โ and git will go get one the same way it does for all your other credentials. Seegitcredentials(7)for more. So the syntax is[protocol://][user[:password]@]proxyhost[:port][/path]. Also this can be overridden per-remote; seeremote.<name>.proxy.
Any proxy, however you configured it, has to be completely transparent โ it must not modify, transform, or buffer the request or response in any way, shape, or form. Proxies that aren't fully transparent are known to cause various forms of breakage with Git. ๐ญ Like, don't do it bestie.
http.proxyAuthMethodโ Sets the method used to authenticate against the HTTP proxy. Heads up: this only kicks in if the proxy string you configured actually contains a user name part (so, the formuser@hostoruser@host:port). Can be overridden per-remote โ seeremote.<name>.proxyAuthMethod. And both of those can be overridden by theGIT_HTTP_PROXY_AUTHMETHODenvironment variable. The possible values:anyauthโ automatically picks a suitable authentication method. The assumption is that the proxy answers an unauthenticated request with a407status code plus one or moreProxy-authenticateheaders listing supported authentication methods. This is the default. โจbasicโ HTTP Basic authenticationdigestโ HTTP Digest authentication; this is the one that keeps the password from being transmitted to the proxy in clear text ๐negotiateโ GSS-Negotiate authentication (compare the--negotiateoption ofcurl(1))ntlmโ NTLM authentication (compare the--ntlmoption ofcurl(1))
http.proxySSLCertโ The pathname of a file storing a client certificate, used to authenticate with an HTTPS proxy. Can be overridden by theGIT_PROXY_SSL_CERTenvironment variable.http.proxySSLKeyโ The pathname of a file storing a private key, used to authenticate with an HTTPS proxy. Can be overridden by theGIT_PROXY_SSL_KEYenvironment variable.http.proxySSLCertPasswordProtectedโ Turns on Git's own password prompt for the proxy SSL certificate. Otherwise OpenSSL will prompt the user โ possibly many times ๐ฉ โ if the certificate or private key is encrypted. Can be overridden by theGIT_PROXY_SSL_CERT_PASSWORD_PROTECTEDenvironment variable.http.proxySSLCAInfoโ Pathname to the file containing the certificate bundle that should be used to verify the proxy with when you're using an HTTPS proxy. Can be overridden by theGIT_PROXY_SSL_CAINFOenvironment variable.http.emptyAuthโ Attempt authentication without seeking a username or password. This lets you attempt GSS-Negotiate authentication without specifying a username in the URL, since libcurl normally requires a username for authentication. Possible values:auto(default) โ send empty credentials only if the server's401response advertises an authentication mechanism that requires them (like GSS-Negotiate); otherwise fall back to prompting via the credential helper.trueโ always send empty credentials on the very first request, before receiving any401response from the server.falseโ never send empty credentials. Mechanisms that require empty credentials or an explicit username, like GSS-Negotiate, will not work. ๐
http.proactiveAuthโ Attempt authentication without first making an unauthenticated attempt and receiving a401response. This can be used to ensure that all requests are authenticated. Ifhttp.emptyAuthis set totrue, this value has no effect.
If the credential helper you're using specifies an authentication scheme (i.e., via the authtype field), that value will be used; if a username and password is provided without a scheme, then Basic authentication is used. The value of the option determines the scheme requested from the helper. Possible values:
basicโ request Basic authentication from the helper.autoโ allow the helper to pick an appropriate scheme.noneโ disable proactive authentication.
Note that TLS should always be used with this config, because otherwise it's way too easy to accidentally expose plaintext credentials if Basic authentication is selected. ๐ Not the vibe.
http.delegationโ Controls GSSAPI credential delegation. Delegation is disabled by default in libcurl since version7.21.7. Set the parameter to tell the server what it's allowed to delegate when it comes to user credentials. Used with GSS/kerberos. Possible values:noneโ don't allow any delegation.policyโ delegates if and only if theOK-AS-DELEGATEflag is set in the Kerberos service ticket, which is a matter of realm policy.alwaysโ unconditionally allow the server to delegate.
http.extraHeaderโ Pass an additional HTTP header when communicating with a server. If more than one such entry exists, all of them get added as extra headers. And to allow overriding settings inherited from the system config, an empty value will reset the extra headers to the empty list. Clean slate energy โจhttp.cookieFileโ The pathname of a file containing previously stored cookie lines, which should be used in the Git http session if they match the server. The file format of the file you read cookies from should be plain HTTP headers or the Netscape/Mozilla cookie file format (seecurl(1)). Set it to an empty string to accept only new cookies from the server and send them back in successive requests within the same connection. NOTE that the file specified withhttp.cookieFileis used only as input unlesshttp.saveCookiesis set. ๐ชhttp.saveCookiesโ If set, store cookies received during requests to the file specified byhttp.cookieFile. Has no effect ifhttp.cookieFileis unset, or set to an empty string.http.versionโ Use the specified HTTP protocol version when talking to a server. If you want to force the default. The available and default version depend on libcurl. Currently the possible values of this option are:HTTP/2HTTP/1.1
http.curloptResolveโ Hostname resolution info that libcurl will use first when sending HTTP requests. This info should be in one of the following formats:[+]HOST:PORT:ADDRESS[,ADDRESS]-HOST:PORT
The first format redirects all requests to the given HOST:PORT to the provided ADDRESS(es). The second format clears all previous config values for that HOST:PORT combination. And to allow easy overriding of all the settings inherited from the system config, an empty value will reset all resolution information to the empty list.
http.sslVersionโ The SSL version to use when negotiating an SSL connection, if you want to force the default. The available and default version depend on whether libcurl was built against NSS or OpenSSL and the particular configuration of the crypto library in use. Internally this sets theCURLOPT_SSL_VERSIONoption; see the libcurl documentation for more details on the format of this option and for the ssl versions supported. Currently the possible values of this option are:sslv2sslv3tlsv1tlsv1.0tlsv1.1tlsv1.2tlsv1.3
Can be overridden by the GIT_SSL_VERSION environment variable. To force git to use libcurl's default ssl version and ignore any explicit http.sslversion option, set GIT_SSL_VERSION to the empty string. ๐
http.sslCipherListโ A list of SSL ciphers to use when negotiating an SSL connection. The available ciphers depend on whether libcurl was built against NSS or OpenSSL and the particular configuration of the crypto library in use. Internally this sets theCURLOPT_SSL_CIPHER_LISToption; see the libcurl documentation for more details on the format of this list.
Can be overridden by the GIT_SSL_CIPHER_LIST environment variable. To force git to use libcurl's default cipher list and ignore any explicit http.sslCipherList option, set GIT_SSL_CIPHER_LIST to the empty string.
http.sslVerifyโ Whether to verify the SSL certificate when fetching or pushing over HTTPS. Defaults totrue. Can be overridden by theGIT_SSL_NO_VERIFYenvironment variable.http.sslCertโ File containing the SSL certificate when fetching or pushing over HTTPS. Can be overridden by theGIT_SSL_CERTenvironment variable.http.sslKeyโ File containing the SSL private key when fetching or pushing over HTTPS. Can be overridden by theGIT_SSL_KEYenvironment variable.http.sslCertPasswordProtectedโ Turns on Git's password prompt for the SSL certificate. Otherwise OpenSSL will prompt the user, possibly many times, if the certificate or private key is encrypted. Can be overridden by theGIT_SSL_CERT_PASSWORD_PROTECTEDenvironment variable.http.sslCAInfoโ File containing the certificates to verify the peer with when fetching or pushing over HTTPS. Can be overridden by theGIT_SSL_CAINFOenvironment variable.http.sslCAPathโ Path containing files with the CA certificates to verify the peer with when fetching or pushing over HTTPS. Can be overridden by theGIT_SSL_CAPATHenvironment variable.http.sslBackendโ Name of the SSL backend to use (e.g."openssl"or"schannel"). This option is ignored if cURL lacks support for choosing the SSL backend at runtime.http.sslCertTypeโ Type of client certificate used when fetching or pushing over HTTPS."PEM"and"DER"are supported when using the openssl or gnutls backends."P12"is supported on"openssl","schannel","securetransport", and gnutls8.11+. See also libcurlCURLOPT_SSLCERTTYPE. Can be overridden by theGIT_SSL_CERT_TYPEenvironment variable. ๐ฆ
http.sslKeyType</p>
So your client private key for HTTPS fetch/push โ what type is it? Ngl this one's for the crypto girlies. Values are like "PEM", "DER", or "ENG". โจ Only applies when you're on the "openssl" backend, and heads up, "DER" is not supported with openssl. It's particularly useful when set to "ENG" for authenticating with PKCS#11 tokens, with a PKCS#11 URL in the sslCert option. See also libcurl CURLOPT_SSLKEYTYPE. Can be overridden by the GIT_SSL_KEY_TYPE environment variable. ๐
http.schannelCheckRevoke
Used to enforce or disable certificate revocation checks in cURL when http.sslBackend is set to "schannel". Defaults to true if unset. Only necessary to disable this if Git consistently errors and the message is about checking the revocation status of a certificate ๐ญ. This option is ignored if cURL lacks support for setting the relevant SSL option at runtime.
http.schannelUseSSLCAInfo
As of cURL v7.60.0, the Secure Channel backend can use the certificate bundle provided via http.sslCAInfo, but that would override the Windows Certificate Store. Since this is not desirable by default, Git will tell cURL not to use that bundle by default when the schannel backend was configured via http.sslBackend โ unless http.schannelUseSSLCAInfo overrides this behavior. ๐ช
http.pinnedPubkey
The public key of the https service, bestie. It may either be the filename of a PEM or DER encoded public key file, or a string starting with sha256// followed by the base64 encoded sha256 hash of the public key. See also libcurl CURLOPT_PINNEDPUBLICKEY. And fr fr, git will exit with an error if this option is set but not supported by cURL. ๐
http.sslTry
Attempt to use AUTH SSL/TLS and encrypted data transfers when connecting via regular FTP protocol. Might be needed if the FTP server requires it for security reasons, or if you just wish to connect securely whenever the remote FTP server supports it. Default is false since it might trigger certificate verification errors on misconfigured servers. ๐
http.maxRequests
How many HTTP requests to launch in parallel. Can be overridden by the GIT_HTTP_MAX_REQUESTS environment variable. Default is 5. ๐โโ๏ธ
http.minSessions
The number of curl sessions (counted across slots) to be kept across requests. They will not be ended with curl_easy_cleanup() until http_cleanup() is invoked. If USE_CURL_MULTI is not defined, this value will be capped at 1. Defaults to 1.
http.postBuffer
Maximum size in bytes of the buffer used by smart HTTP transports when POSTing data to the remote system. For requests larger than this buffer size, HTTP/1.1 and Transfer-Encoding: chunked is used to avoid creating a massive pack file locally. Default is 1 MiB, which is sufficient for most requests. ๐
Note that raising this limit is only effective for disabling chunked transfer encoding, and therefore should be used only where the remote server or a proxy only supports HTTP/1.0 or is noncompliant with the HTTP standard. Raising this is not, in general, an effective solution for most push problems, but it can increase memory consumption significantly, since the entire buffer is allocated even for small pushes. ๐ญ
http.lowSpeedLimit, http.lowSpeedTime
If the HTTP transfer speed, in bytes per second, is less than http.lowSpeedLimit for longer than http.lowSpeedTime seconds, the transfer is aborted. Can be overridden by the GIT_HTTP_LOW_SPEED_LIMIT and GIT_HTTP_LOW_SPEED_TIME environment variables. ๐
http.keepAliveIdle
Specifies how long in seconds to wait on an idle connection before sending TCP keepalive probes (if supported by the OS). If unset, curl's default value is used. Can be overridden by the GIT_HTTP_KEEPALIVE_IDLE environment variable.
http.keepAliveInterval
Specifies how long in seconds to wait between TCP keepalive probes (if supported by the OS). If unset, curl's default value is used. Can be overridden by the GIT_HTTP_KEEPALIVE_INTERVAL environment variable.
http.keepAliveCount
Specifies how many TCP keepalive probes to send before giving up and terminating the connection (if supported by the OS). If unset, curl's default value is used. Can be overridden by the GIT_HTTP_KEEPALIVE_COUNT environment variable. ๐ซถ
http.retryAfter
Default wait time in seconds before retrying when a server returns HTTP 429 (Too Many Requests) without a Retry-After header. Defaults to 0 (retry immediately). When a Retry-After header is present, its value takes precedence over this setting โ however, automatic use of the server-provided Retry-After header requires libcurl 7.66.0 or later. On older versions, configure this setting manually to control the retry delay. Can be overridden by the GIT_HTTP_RETRY_AFTER environment variable. See also http.maxRetries and http.maxRetryTime. ๐
http.maxRetries
Maximum number of times to retry after receiving HTTP 429 (Too Many Requests) responses. Set to 0 (the default) to disable retries. Can be overridden by the GIT_HTTP_MAX_RETRIES environment variable. See also http.retryAfter and http.maxRetryTime.
http.maxRetryTime
Maximum time in seconds to wait for a single retry attempt when handling HTTP 429 (Too Many Requests) responses. If the server requests a delay (via Retry-After header) or if http.retryAfter is configured with a value that exceeds this maximum, Git will fail immediately rather than waiting. Default is 300 seconds (5 minutes). Can be overridden by the GIT_HTTP_MAX_RETRY_TIME environment variable. See also http.retryAfter and http.maxRetries. โฐ
http.noEPSV
A boolean which disables using of EPSV ftp command by curl. This can be helpful with some "poor" ftp servers which don't support EPSV mode ๐ฌ. Can be overridden by the GIT_CURL_FTP_NO_EPSV environment variable. Default is false (curl will use EPSV).
http.userAgent
The HTTP USER_AGENT string presented to an HTTP server. The default value represents the version of the Git client such as git/1.7.1. This option allows you to override this value to a more common value such as Mozilla/4.0. This may be necessary, for instance, if connecting through a firewall that restricts HTTP connections to a set of common USER_AGENT strings (but not including those like git/1.7.1). Can be overridden by the GIT_HTTP_USER_AGENT environment variable. ๐ต๏ธโโ๏ธ
http.followRedirects
Whether git should follow HTTP redirects. If set to true, git will transparently follow any redirect issued by a server it encounters. If set to false, git will treat all redirects as errors. If set to initial, git will follow redirects only for the initial request to a remote, but not for subsequent follow-up HTTP requests. Since git uses the redirected URL as the base for the follow-up requests, this is generally sufficient. The default is initial. ๐
http.<url>.*
Okay this one's the main character ๐ โ any of the http.* options above can be applied selectively to some URLs. For a config key to match a URL, each element of the config key is compared to that of the URL, in the following order:
- Scheme (e.g.,
httpsinhttps://example.com/). This field must match exactly between the config key and the URL. - Host/domain name (e.g.,
example.cominhttps://example.com/). This field must match between the config key and the URL. It is possible to specify a*as part of the host name to match all subdomains at this level.https://*.example.com/for example would matchhttps://foo.example.com/, but nothttps://foo.bar.example.com/. - Port number (e.g.,
8080inhttp://example.com:8080/). This field must match exactly between the config key and the URL. Omitted port numbers are automatically converted to the correct default for the scheme before matching. - Path (e.g.,
repo.gitinhttps://example.com/repo.git). The path field of the config key must match the path field of the URL either exactly or as a prefix of slash-delimited path elements. This means a config key with pathfoo/matches URL pathfoo/bar. A prefix can only match on a slash (/) boundary. Longer matches take precedence (so a config key with pathfoo/baris a better match to URL pathfoo/barthan a config key with just pathfoo/). - User name (e.g.,
userinhttps://user@example.com/repo.git). If the config key has a user name it must match the user name in the URL exactly. If the config key does not have a user name, that config key will match a URL with any user name (including none), but at a lower precedence than a config key with a user name.
The list above is ordered by decreasing precedence โ a URL that matches a config key's path is preferred to one that matches its user name. For example, if the URL is https://user@example.com/foo/bar a config key match of https://example.com/foo will be preferred over a config key match of https://user@example.com.
All URLs are normalized before attempting any matching (the password part, if embedded in the URL, is always ignored for matching purposes) so that equivalent URLs that are simply spelled differently will match properly. Environment variable settings always override any matches. The URLs that are matched against are those given directly to Git commands. This means any URLs visited as a result of a redirection do not participate in matching. ๐
i18n.commitEncoding
Character encoding the commit messages are stored in. Git itself does not care per se, but this information is necessary e.g. when importing commits from emails or in the gitk graphical history browser (and possibly in other places in the future or in other porcelains). See e.g. git-mailinfo(1). Defaults to utf-8. ๐
i18n.logOutputEncoding
Character encoding the commit messages are converted to when running git log and friends. ๐ฆ
imap.folder
The folder to drop the mails into, which is typically the Drafts folder. For example: INBOX.Drafts, INBOX/Drafts or [Gmail]/Drafts. The IMAP folder to interact with MUST be specified; the value of this configuration variable is used as the fallback default value when the --folder option is not given. ๐ฌ
imap.tunnel
Command used to set up a tunnel to the IMAP server through which commands will be piped instead of using a direct network connection to the server. Required when imap.host is not set. ๐
imap.hostโ a URL that says which server we're talking to ๐. Use animap://prefix for non-secure connections and animaps://prefix for secure ones. It's ignored whenimap.tunnelis set, but otherwise it's required, bestie โ no host, no party.imap.userโ the username to use when logging in to the server. your lil name tag ๐ท๏ธimap.passโ the password to use when logging in to the server. keep it secret, keep it safe ๐คซimap.portโ an integer port number to connect to on the server. Defaults to143forimap://hosts and993forimaps://hosts. Ignored whenimap.tunnelis set.imap.sslverifyโ a boolean to enable/disable verification of the server certificate used by the SSL/TLS connection. Default istrue. Ignored whenimap.tunnelis set. (Turning this off is giving "i trust you bestie" energy โ do it at your own risk ๐)imap.preformattedHTMLโ a boolean to enable/disable the use of html encoding when sending a patch. An html encoded patch will be bracketed with<pre>and have a content type oftext/html. Ironically, enabling this option causes Thunderbird to send the patch as aplain/text,format=fixedemail. Default isfalse. the irony is literally the whole plot ๐ญimap.authMethodโ specify the authentication method for authenticating with the IMAP server. If Git was built with theNO_CURLoption, or if your curl version is older than7.34.0, or if you're runninggit-imap-sendwith the--no-curloption, the only supported methods arePLAIN,CRAM-MD5,OAUTHBEARERandXOAUTH2. If this is not set thengit imap-senduses the basic IMAP plaintextLOGINcommand.include.path,includeIf.<condition>.pathโ special variables to include other configuration files ๐ซถ. See the "CONFIGURATION FILE" section in the maingit-config(1)documentation, specifically the "Includes" and "Conditional Includes" subsections. go read those, they're iconic.
index.recordEndOfIndexEntriesโ specifies whether the index file should include an "End Of Index Entry" section. This reduces index load time on multiprocessor machines but produces a message"ignoring EOIE extension"when reading the index using Git versions before2.20. Defaults totrueifindex.threadshas been explicitly enabled,falseotherwise.index.recordOffsetTableโ specifies whether the index file should include an "Index Entry Offset Table" section. This reduces index load time on multiprocessor machines but produces a message"ignoring IEOT extension"when reading the index using Git versions before2.20. Defaults totrueifindex.threadshas been explicitly enabled,falseotherwise. same vibe, different table ๐ชโจindex.sparseโ when enabled, write the index using sparse-directory entries. This has no effect unlesscore.sparseCheckoutandcore.sparseCheckoutConeare both enabled. Defaults tofalse.index.threadsโ specifies the number of threads to spawn when loading the index. This is meant to reduce index load time on multiprocessor machines. Specifying0ortruewill cause Git to auto-detect the number of CPUs and set the number of threads accordingly. Specifying1orfalsewill disable multithreading. Defaults totrue. parallelism slay ๐ฅindex.versionโ specify the version with which new index files should be initialized. This does not affect existing repositories. Iffeature.manyFilesis enabled, then the default is4. new files only, okurrr ๐index.skipHashโ when enabled, do not compute the trailing hash for the index file. This accelerates Git commands that manipulate the index, such asgit add,git commit, orgit status. Instead of storing the checksum, write a trailing set of bytes with value zero, indicating that the computation was skipped.
If you enable index.skipHash, then Git clients older than 2.13.0 will refuse to parse the index and Git clients older than 2.40.0 will report an error during git fsck.
โ ๏ธ like, this is a real compatibility consequence, bestie โ old Git will straight up nope out ๐ญ read it twice.
init.templateDirโ specify the directory from which templates will be copied. (See the "TEMPLATE DIRECTORY" section ofgit-init(1).) it's giving starter pack ๐init.defaultBranchโ allows overriding the default branch name e.g. when initializing a new repository. name your baby whatever you want ๐init.defaultObjectFormatโ allows overriding the default object format for new repositories. See--object-format=ingit-init(1). Both the command line option and theGIT_DEFAULT_HASHenvironment variable take precedence over this config.init.defaultRefFormatโ allows overriding the default ref storage format for new repositories. See--ref-format=ingit-init(1). Both the command line option and theGIT_DEFAULT_REF_FORMATenvironment variable take precedence over this config. the command line and env var are the main characters here ๐init.defaultSubmodulePathConfigโ a boolean that specifies ifgit initandgit cloneshould automatically setextensions.submodulePathConfigtotrue. This allows all new repositories to automatically use the submodule path extension. Defaults tofalsewhen unset.
instaweb.browserโ specify the program that will be used to browse your working repository ingitweb. Seegit-instaweb(1).instaweb.httpdโ the HTTP daemon command-line to startgitwebon your working repository. Seegit-instaweb(1).instaweb.localโ if true the web server started bygit-instaweb(1)will be bound to the local IP (127.0.0.1). stay home bestie ๐instaweb.modulePathโ the default module path forgit-instaweb(1)to use instead of/usr/lib/apache2/modules. Only used if httpd is Apache.instaweb.portโ the port number to bind thegitwebhttpd to. Seegit-instaweb(1).
interactive.singleKeyโ when set totrue, allow the user to provide one-letter input with a single key (i.e., without hitting the Enter key) in interactive commands ๐น. This is currently used by the--patchmode ofgit-add(1),git-checkout(1),git-restore(1),git-commit(1),git-reset(1), andgit-stash(1).interactive.diffFilterโ when an interactive command (such asgit add --patch) shows a colorized diff, git will pipe the diff through the shell command defined by this configuration variable. The command may mark up the diff further for human consumption, provided that it retains a one-to-one correspondence with the lines in the original diff ๐. Defaults to disabled (no filtering).
๐จ one-to-one correspondence, bestie โ if your filter transforms the lines, the whole thing breaks. no adding extra lines, periodt.
log.abbrevCommitโ iftrue, makegit-log(1),git-show(1), andgit-whatchanged(1)assume--abbrev-commit. You may override this option with--no-abbrev-commit.log.dateโ set the default date-time mode for thelogcommand. Setting a value forlog.dateis similar to usinggit log's--dateoption. Seegit-log(1)for details.
If the format is set to "auto:foo" and the pager is in use, format "foo" will be used for the date format. Otherwise, "default" will be used. cute lil auto-magic โจ
log.decorateโ print out the ref names of any commits that are shown by the log command. Possible values are:shortโ the ref name prefixesrefs/heads/,refs/tags/andrefs/remotes/are not printed.fullโ the full ref name (including prefix) are printed.autoโ if the output is going to a terminal, the ref names are shown as ifshortwere given, otherwise no ref names are shown.
This is the same as the --decorate option of the git log. โจ
log.initialDecorationSetโ by default,git logonly shows decorations for certain known ref namespaces. Ifallis specified, then show all refs as decorations.log.excludeDecorationโ exclude the specified patterns from the log decorations. This is similar to the--decorate-refs-excludecommand-line option, but the config option can be overridden by the--decorate-refsoption.log.diffMergesโ set diff format to be used when--diff-merges=onis specified, see--diff-mergesingit-log(1)for details. Defaults toseparate.log.followโ iftrue,git logwill act as if the--followoption was used when a single <path> is given. This has the same limitations as--follow, i.e. it cannot be used to follow multiple files ๐. one path only, bestie.log.graphColorsโ a list of colors, separated by commas, that can be used to draw history lines ingit log --graph. paint the timeline ๐จlog.graphIndentโ if true, indent visual roots when rendering the graphs with--graph. Settrueby default. It can be overriden with--[no-]graph-indent.log.showRootโ iftrue, the initial commit will be shown as a big creation event ๐. This is equivalent to a diff against an empty tree. Tools likegit-log(1)orgit-whatchanged(1), which normally hide the root commit will now show it. True by default.log.showSignatureโ iftrue, makesgit-log(1),git-show(1), andgit-whatchanged(1)assume--show-signature.log.mailmapโ iftrue, makesgit-log(1),git-show(1), andgit-whatchanged(1)assume--use-mailmap, otherwise assume--no-use-mailmap. True by default.
lsrefs.unbornโ may be"advertise"(the default),"allow", or"ignore". If"advertise", the server will respond to the client sending"unborn"(as described ingitprotocol-v2(5)) and will advertise support for this feature during the protocol v2 capability advertisement."allow"is the same as"advertise"except that the server will not advertise support for this feature; this is useful for load-balanced servers that cannot be updated atomically (for example), since the administrator could configure"allow", then after a delay, configure"advertise". big rollout-brain energy ๐ง โจmailinfo.scissorsโ iftrue, makesgit-mailinfo(1)(and thereforegit-am(1)) act by default as if the--scissorsoption was provided on the command-line. When active, this feature removes everything from the message body before a scissors line (i.e. consisting mainly of">8","8<"and"-"). โ๏ธ snip snipmailmap.fileโ the location of an augmenting mailmap file. The default mailmap, located in the root of the repository, is loaded first, then the mailmap file pointed to by this variable. The location of the mailmap file may be in a repository subdirectory, or somewhere outside of the repository itself. Seegit-shortlog(1)andgit-blame(1). ๐mailmap.blobโ likemailmap.file, but consider the value as a reference to a blob in the repository. If bothmailmap.fileandmailmap.blobare given, both are parsed, with entries frommailmap.filetaking precedence. In a bare repository, this defaults toHEAD:.mailmap. In a non-bare repository, it defaults to empty.
๐ก precedence check: mailmap.file wins, always. write it down.
maintenance.autoโ this boolean config option controls whether some commands rungit maintenance run --autoafter doing their normal work. Defaults totrue. lil background chore fairy ๐งโจ
maintenance.autoDetach
Okay so bestie, lots of Git commands trigger automatic maintenance after they've written data into the repository โจ This boolean config option is basically the vibe check on whether that automatic maintenance happens in the foreground or whether the maintenance process detaches and just keeps running in the background like it's got somewhere better to be ๐
If it's unset, the value of gc.autoDetach is used as a fallback. And it defaults to true if both of them are unset โ which means the maintenance process will detach. Periodt.
maintenance.strategy
This string config option is your little menu of recommended strategies for repository maintenance ๐ It controls which tasks get run during git maintenance run, provided no --task=<task> arguments are provided. This setting impacts manual maintenance, auto-maintenance and scheduled maintenance โ the tasks that run may be different depending on the maintenance type. iykyk.
You can tweak the strategy further by setting maintenance.<task>.enabled and maintenance.<task>.schedule. If those are set, they're used instead of the defaults that maintenance.strategy hands you ๐ซถ
The possible strategies are:
noneโ no tasks are run at all, literally nothing, a total rest day ๐ This is the default strategy for scheduled maintenance.gcโ runs thegctask.geometricโ performs geometric repacking of packfiles and keeps auxiliary data structures up-to-date. The strategy expires data in the reflog and removes worktrees that can't be located anymore. When the geometric repacking strategy would decide to do an all-into-one repack, then the strategy generates a cruft pack for all unreachable objects ๐ Objects that are already part of a cruft pack will be expired. This repacking strategy is a full replacement for thegcstrategy and is recommended for large repositories ๐ This is the default strategy for manual maintenance.incrementalโ this setting optimizes for performing small maintenance activities that don't delete any data ๐ It does not schedule thegctask, but it runs theprefetchandcommit-graphtasks hourly, theloose-objectsandincremental-repacktasks daily, and thepack-refstask weekly. Manual repository maintenance uses thegctask.
maintenance.<task>.enabled
A boolean config option that controls whether the maintenance task named <task> is run when no --task option is specified to git maintenance run ๐ฆ These config values are ignored if a --task option exists. By default, only maintenance.gc.enabled is true.
maintenance.<task>.schedule
This one controls whether or not the given <task> runs during a git maintenance run --schedule=<frequency> command โญ The value has to be one of "hourly", "daily", or "weekly".
maintenance.commit-graph.auto
An integer config option controlling how often the commit-graph task should be run as part of git maintenance run --auto ๐
- If
zero, thecommit-graphtask will not run with the--autooption. - A negative value forces the task to run every single time, no cap.
- Otherwise, a positive value implies the command should run when the number of reachable commits that are not in the commit-graph file is at least the value of
maintenance.commit-graph.auto.
The default value is 100.
maintenance.loose-objects.auto
An integer config option for how often the loose-objects task should be run as part of git maintenance run --auto ๐
zeroโ theloose-objectstask will not run with the--autooption.- Negative โ forces the task to run every time.
- Positive โ the command should run when the number of loose objects is at least the value of
maintenance.loose-objects.auto.
The default value is 100.
maintenance.loose-objects.batchSize
An integer config option that caps the maximum number of loose objects written into a packfile during the loose-objects task ๐ The default is fifty thousand. Use value 0 to indicate no limit โ go feral, bestie.
maintenance.incremental-repack.auto
An integer config option for how often the incremental-repack task should be run as part of git maintenance run --auto ๐ง
zeroโ theincremental-repacktask will not run with the--autooption.- Negative โ forces the task to run every time.
- Positive โ the command should run when the number of pack-files not in the multi-pack-index is at least the value of
maintenance.incremental-repack.auto.
The default value is 10.
maintenance.geometric-repack.auto
An integer config option for how often the geometric-repack task should be run as part of git maintenance run --auto ๐
zeroโ thegeometric-repacktask will not run with the--autooption.- Negative โ forces the task to run every time.
- Positive โ the command should run either when there are packfiles that need to be merged together to retain the geometric progression, or when there are at least this many loose objects that would be written into a new packfile.
The default value is 6700.
maintenance.geometric-repack.splitFactor
An integer config option controlling the factor used for the geometric sequence โจ See the --geometric= option in git-repack(1) for more details. Defaults to 2.
maintenance.reflog-expire.auto
An integer config option for how often the reflog-expire task should be run as part of git maintenance run --auto ๐ธ
zeroโ thereflog-expiretask will not run with the--autooption.- Negative โ forces the task to run every time.
- Positive โ the command should run when the number of expired reflog entries in the
"HEAD"reflog is at least the value ofmaintenance.loose-objects.auto.
The default value is 100.
maintenance.rerere-gc.auto
An integer config option for how often the rerere-gc task should be run as part of git maintenance run --auto ๐
zeroโ thererere-gctask will not run with the--autooption.- Negative โ forces the task to run every time.
- Positive โ the command should run when the estimated number of stale entries that would be pruned is greater than or equal to the configured value.
The default value is 512.
maintenance.worktree-prune.auto
An integer config option for how often the worktree-prune task should be run as part of git maintenance run --auto ๐ฆ
zeroโ theworktree-prunetask will not run with the--autooption.- Negative โ forces the task to run every time.
- Positive โ the command should run when the number of prunable worktrees exceeds the value.
The default value is 1.
man.viewer
Specifies the programs that may be used to display help in the man format ๐
See git-help(1).
man.<tool>.cmd
Specifies the command to invoke the specified man viewer ๐ The specified command is evaluated in shell with the man page passed as an argument. (See git-help(1).)
man.<tool>.path
Overrides the path for the given tool that may be used to display help in the man format โญ See git-help(1).
merge.conflictStyle
Specifies the style in which conflicted hunks are written out to working tree files upon merge ๐ญ The default is "merge", which shows a <<<<<<< conflict marker, changes made by one side, a ======= marker, changes made by the other side, and then a >>>>>>> marker. An alternate style, "diff3", adds a ||||||| marker and the original text before the ======= marker ๐ The "merge" style tends to produce smaller conflict regions than diff3, both because of the exclusion of the original text, and because when a subset of lines match on the two sides, they're just pulled out of the conflict region.
Another alternate style, "zdiff3", is similar to diff3 but removes matching lines on the two sides from the conflict region when those matching lines appear near either the beginning or end of a conflict region ๐
merge.defaultToUpstream
If merge is called without any commit argument, merge the upstream branches configured for the current branch by using their last observed values stored in their remote-tracking branches ๐ The values of the branch.<current branch>.merge that name the branches at the remote named by branch.<current-branch>.remote are consulted, and then they're mapped via remote.<remote>.fetch to their corresponding remote-tracking branches, and the tips of these tracking branches are merged. Defaults to true.
merge.ff
By default, Git does not create an extra merge commit when merging a commit that's a descendant of the current commit โ instead, the tip of the current branch is fast-forwarded โจ
- When set to
false, this variable tells Git to create an extra merge commit in such a case (equivalent to giving the--no-ffoption from the command line). - When set to
only, only such fast-forward merges are allowed (equivalent to giving the--ff-onlyoption from the command line).
merge.verifySignatures
If true, this is equivalent to the --verify-signatures command line option ๐ฅ See git-merge(1) for details.
merge.branchdesc
In addition to branch names, populates the log message with the branch description text associated with them ๐ Defaults to false.
merge.log
In addition to branch names, populates the log message with at most the specified number of one-line descriptions from the actual commits that are being merged ๐ Defaults to false, and true is a synonym for 20.
merge.suppressDest
By adding a glob that matches the names of integration branches to this multi-valued configuration variable, the default merge message computed for merges into these integration branches will omit "into <branch-name>" from its title ๐
An element with an empty value can be used to clear the list of globs accumulated from previous configuration entries. When there's no merge.suppressDest variable defined, the default value of master is used for backward compatibility. iykyk ๐ซถ
merge.renameLimitโ how many files Git will actually look at in the exhaustive part of rename detection during a merge. โจ No value set? It falls back to whateverdiff.renameLimitsays. And if neithermerge.renameLimitnordiff.renameLimitis set, it currently defaults to7000. Heads up bestie: this setting does absolutely nothing if rename detection is turned off. ๐merge.renamesโ does Git detect renames or not? Set it tofalseand rename detection is disabled, periodt. Set it totrueand basic rename detection is on. Defaults to the value ofdiff.renames. ๐ฆmerge.directoryRenamesโ does Git detect directory renames? This one's about what happens at merge time to new files added to a directory on one side of history when that directory got renamed on the other side of history. Possible values, get into it:falseโ directory rename detection is disabled, meaning those new files just get left behind in the old directory. ๐ญtrueโ directory rename detection is enabled, meaning those new files get moved into the new directory. slay. ๐conflictโ a conflict gets reported for such paths. ๐
Also important: if merge.renames is false, then merge.directoryRenames is ignored and treated as false. Defaults to conflict.
merge.renormalizeโ tells Git that the canonical representation of files in the repo has changed over time (like, earlier commits recorded text files with CRLF line endings but recent ones use LF line endings). In a repo like that, for each file where a three-way content merge is needed, Git can convert the data recorded in commits to a canonical form before doing the merge, so you get fewer unnecessary conflicts. ๐ For more info, see the section "Merging branches with differing checkin/checkout attributes" ingitattributes(5).merge.statโ what, if anything, Git prints betweenORIG_HEADand the merge result at the end of the merge. The options are:falseโ show nothing. ๐trueโ showgit diff --diffstat --summary ORIG_HEAD.compactโ showgit diff --compact-summary ORIG_HEAD.
But plot twist: any unrecognised value (like, a value added by a future version of Git) is taken as true instead of triggering an error. Defaults to true. โจ
merge.autoStashโ set it totrueand Git automatically creates a temporary stash entry before the operation begins, then applies it after the operation ends. Which means you can run merge on a dirty worktree, no cap. ๐ซถ But use it with care: the final stash application after a successful merge might result in non-trivial conflicts. ๐ญ This option can be overridden by the--no-autostashand--autostashoptions ofgit-merge(1). Defaults tofalse.merge.toolโ controls which merge toolgit-mergetool(1)uses. The list below shows the valid built-in values. Any other value is treated as a custom merge tool and requires that a correspondingmergetool.<tool>.cmdvariable is defined. ๐merge.guitoolโ controls which merge toolgit-mergetool(1)uses when the-g/--guiflag is specified. The list below shows the valid built-in values. Any other value is treated as a custom merge tool and requires that a correspondingmergetool.<guitool>.cmdvariable is defined. ๐araxisโ use Araxis Merge (requires a graphical session)bcโ use Beyond Compare (requires a graphical session)bc3โ use Beyond Compare (requires a graphical session)bc4โ use Beyond Compare (requires a graphical session)codecompareโ use Code Compare (requires a graphical session)deltawalkerโ use DeltaWalker (requires a graphical session)diffmergeโ use DiffMerge (requires a graphical session)diffuseโ use Diffuse (requires a graphical session)ecmergeโ use ECMerge (requires a graphical session)emergeโ use Emacs' Emergeexamdiffโ use ExamDiff Pro (requires a graphical session)guiffyโ use Guiffyโs Diff Tool (requires a graphical session)gvimdiffโ use gVim (requires a graphical session) with a custom layout (seegit help mergetool's BACKEND SPECIFIC HINTS section)gvimdiff1โ use gVim (requires a graphical session) with a 2 panes layout (LOCALandREMOTE)gvimdiff2โ use gVim (requires a graphical session) with a 3 panes layout (LOCAL,MERGEDandREMOTE)gvimdiff3โ use gVim (requires a graphical session) where only theMERGEDfile is shownkdiff3โ use KDiff3 (requires a graphical session)meldโ use Meld (requires a graphical session) with optional auto merge (seegit help mergetool's CONFIGURATION section)nvimdiffโ use Neovim with a custom layout (seegit help mergetool's BACKEND SPECIFIC HINTS section)nvimdiff1โ use Neovim with a 2 panes layout (LOCALandREMOTE)nvimdiff2โ use Neovim with a 3 panes layout (LOCAL,MERGEDandREMOTE)nvimdiff3โ use Neovim where only theMERGEDfile is shownopendiffโ use FileMerge (requires a graphical session)p4mergeโ use HelixCore P4Merge (requires a graphical session)smergeโ use Sublime Merge (requires a graphical session)tkdiffโ use TkDiff (requires a graphical session)tortoisemergeโ use TortoiseMerge (requires a graphical session)vimdiffโ use Vim with a custom layout (seegit help mergetool's BACKEND SPECIFIC HINTS section)vimdiff1โ use Vim with a 2 panes layout (LOCALandREMOTE)vimdiff2โ use Vim with a 3 panes layout (LOCAL,MERGEDandREMOTE)vimdiff3โ use Vim where only theMERGEDfile is shownvscodeโ use Visual Studio Code (requires a graphical session)winmergeโ use WinMerge (requires a graphical session)xxdiffโ use xxdiff (requires a graphical session)
merge.verbosityโ controls how much output the recursive merge strategy shows. Level0outputs nothing except a final error message if conflicts were detected. Level1outputs only conflicts,2outputs conflicts and file changes. Level5and above outputs debugging information. The default is level2. Can be overridden by theGIT_MERGE_VERBOSITYenvironment variable. ๐งmerge.<driver>.nameโ defines a human-readable name for a custom low-level merge driver. Seegitattributes(5)for details. โญmerge.<driver>.driverโ defines the command that implements a custom low-level merge driver. Seegitattributes(5)for details.merge.<driver>.recursiveโ names a low-level merge driver to be used when performing an internal merge between common ancestors. Seegitattributes(5)for details.mergetool.<tool>.pathโ overrides the path for the given tool. Super useful in case your tool isn't in the$PATH. ๐mergetool.<tool>.cmdโ specifies the command to invoke the specified merge tool. The command gets evaluated in shell with these variables available:BASEis the name of a temporary file containing the common base of the files to be merged, if available;LOCALis the name of a temporary file containing the contents of the file on the current branch;REMOTEis the name of a temporary file containing the contents of the file from the branch being merged;MERGEDcontains the name of the file to which the merge tool should write the results of a successful merge. ๐mergetool.<tool>.hideResolvedโ lets you override the globalmergetool.hideResolvedvalue for one specific tool. Seemergetool.hideResolvedfor the full description.mergetool.<tool>.trustExitCodeโ for a custom merge command, this says whether the exit code of the merge command can be used to determine whether the merge was successful. If this isn't set totrue, then the merge target file timestamp gets checked, and the merge is assumed successful if the file has been updated; otherwise, the user is prompted to indicate the success of the merge. ๐mergetool.meld.hasOutputโ older versions of meld don't support the--outputoption. Git will try to detect whether meld supports--outputby inspecting the output ofmeld --help. Configuringmergetool.meld.hasOutputmakes Git skip those checks and just use the configured value instead. Settingmergetool.meld.hasOutputtotruetells Git to unconditionally use the--outputoption, andfalseavoids using--output. ๐ฅmergetool.meld.useAutoMergeโ when--auto-mergeis given, meld merges all non-conflicting parts automatically, highlights the conflicting parts, and waits for the user's decision. Settingmergetool.meld.useAutoMergetotruetells Git to unconditionally use the--auto-mergeoption with meld. Setting it toautomakes git detect whether--auto-mergeis supported and only use--auto-mergewhen it's available. A value offalseavoids using--auto-mergealtogether, and is the default value. โจmergetool.<variant>.layoutโ configures the split window layout for vimdiff's<variant>, which is any ofvimdiff,nvimdiff,gvimdiff. When you launchgit mergetoolwith--tool=<variant>(or without--toolifmerge.toolis configured as<variant>), Git consultsmergetool.<variant>.layoutto figure out the tool's layout. If the variant-specific config isn't available,vimdiff's is used as fallback. And if that's not available either, a default layout with 4 windows gets used. To configure the layout, see the BACKEND SPECIFIC HINTS section ingit-mergetool(1). ๐ฆmergetool.hideResolvedโ during a merge, Git automatically resolves as many conflicts as it can and writes the$MERGEDfile containing conflict markers around any conflicts it can't resolve;$LOCALand$REMOTEnormally are the versions of the file from before Git's conflict resolution. This flag causes$LOCALand$REMOTEto be overwritten so that only the unresolved conflicts are presented to the merge tool. Can be configured per-tool via themergetool.<tool>.hideResolvedconfiguration variable. Defaults tofalse. ๐
๐ mergetool.keepBackup
So after a merge goes down, that original file โ the messy one with all the conflict markers in it โ can get saved as a file with a .orig extension. If you set this to false, bestie, that file does not get preserved. Defaults to true (i.e. keep the backup files). ๐
๐ซถ mergetool.keepTemporaries
When Git invokes a custom merge tool, it uses a set of temporary files to pass to the tool. If the tool returns an error and this variable is set to true, then those temporary files will be preserved; otherwise, they get removed after the tool has exited. Defaults to false. โจ
๐ฆ mergetool.writeToTemp
Git writes temporary BASE, LOCAL, and REMOTE versions of conflicting files in the worktree by default. Set this true and Git will attempt to use a temporary directory for these files instead. Defaults to false.
๐ธ mergetool.prompt
Prompt before each invocation of the merge resolution program. That's it, that's the whole vibe. ๐
๐ mergetool.guiDefault
Set it to true to use the merge.guitool by default (equivalent to specifying the --gui argument), or auto to select merge.guitool or merge.tool depending on the presence of a DISPLAY environment variable value. The default is false, where the --gui argument must be provided explicitly for the merge.guitool to be used. no cap.
๐ notes.mergeStrategy
Which merge strategy to choose by default when resolving notes conflicts. Must be one of manual, ours, theirs, union, or cat_sort_uniq. Defaults to manual. See the "NOTES MERGE STRATEGIES" section of git-notes(1) for more information on each strategy.
This setting can be overridden by passing the --strategy option to git-notes(1).
๐ง notes.<name>.mergeStrategy
Which merge strategy to choose when doing a notes merge into refs/notes/<name>. This overrides the more general notes.mergeStrategy. See the "NOTES MERGE STRATEGIES" section in git-notes(1) for more information on the available strategies. ๐
โญ notes.displayRef
Which ref (or refs, if a glob or specified more than once), in addition to the default set by core.notesRef or GIT_NOTES_REF, to read notes from when showing commit messages with the git log family of commands.
This setting can be overridden with the GIT_NOTES_DISPLAY_REF environment variable, which must be a colon separated list of refs or globs.
A warning will be issued for refs that do not exist, but a glob that does not match any refs is silently ignored. ๐
This setting can be disabled by the --no-notes option to the git-log(1) family of commands, or by the --notes=<ref> option accepted by those commands.
The effective value of core.notesRef (possibly overridden by GIT_NOTES_REF) is also implicitly added to the list of refs to be displayed.
๐ notes.rewrite.<command>
When rewriting commits with <command> (currently amend or rebase), if this variable is false, git will not copy notes from the original to the rewritten commit. Defaults to true. See also notes.rewriteRef below.
This setting can be overridden with the GIT_NOTES_REWRITE_REF environment variable, which must be a colon separated list of refs or globs.
๐ฅ notes.rewriteMode
When copying notes during a rewrite (see the notes.rewrite.<command> option), this determines what to do if the target commit already has a note. Must be one of overwrite, concatenate, cat_sort_uniq, or ignore. Defaults to concatenate.
This setting can be overridden with the GIT_NOTES_REWRITE_MODE environment variable.
๐ notes.rewriteRef
When copying notes during a rewrite, specifies the (fully qualified) ref whose notes should be copied. May be a glob, in which case notes in all matching refs will be copied. You may also specify this configuration several times. ๐ซถ
Does not have a default value; you must configure this variable to enable note rewriting. Set it to refs/notes/commits to enable rewriting for the default commit notes.
Can be overridden with the GIT_NOTES_REWRITE_REF environment variable. See notes.rewrite.<command> above for a further description of its format.
๐ pack.window
The size of the window used by git-pack-objects(1) when no window size is given on the command line. Defaults to 10.
๐
pack.depth
The maximum delta depth used by git-pack-objects(1) when no maximum depth is given on the command line. Defaults to 50. Maximum value is 4095. ikyk. ๐
โจ pack.windowMemory
The maximum size of memory that is consumed by each thread in git-pack-objects(1) for pack window memory when no limit is given on the command line. The value can be suffixed with "k", "m", or "g". When left unconfigured (or set explicitly to 0), there will be no limit. ๐ฆ
๐ธ pack.compression
An integer -1..9, indicating the compression level for objects in a pack file. -1 is the zlib default. 0 means no compression, and 1..9 are various speed/size tradeoffs, 9 being slowest. If not set, defaults to core.compression. If that is not set, defaults to -1, the zlib default, which is "a default compromise between speed and compression (currently equivalent to level 6)."
bestie, heads up: changing the compression level will not automatically recompress all existing objects. You can force recompression by passing the-Foption togit-repack(1). ๐ซถ
๐ pack.allowPackReuse
When true or "single", and when reachability bitmaps are enabled, pack-objects will try to send parts of the bitmapped packfile verbatim. When "multi", and when a multi-pack reachability bitmap is available, pack-objects will try to send parts of all packs in the MIDX.
If only a single pack bitmap is available, and pack.allowPackReuse is set to "multi", reuse parts of just the bitmapped packfile. This can reduce memory and CPU usage to serve fetches, but might result in sending a slightly larger pack. Defaults to true.
๐ง pack.island
An extended regular expression configuring a set of delta islands. See "DELTA ISLANDS" in git-pack-objects(1) for details. ๐๏ธ
๐ pack.islandCore
Specify an island name which gets to have its objects be packed first. This creates a kind of pseudo-pack at the front of one pack, so that the objects from the specified island are hopefully faster to copy into any pack that should be served to a user requesting these objects. In practice this means that the island specified should likely correspond to what is the most commonly cloned in the repo. See also "DELTA ISLANDS" in git-pack-objects(1).
โญ pack.deltaCacheSize
The maximum memory in bytes used for caching deltas in git-pack-objects(1) before writing them out to a pack. This cache is used to speed up the writing object phase by not having to recompute the final delta result once the best match for all objects is found. Repacking large repositories on machines which are tight with memory might be badly impacted by this though, especially if this cache pushes the system into swapping. ๐ญ A value of 0 means no limit. The smallest size of 1 byte may be used to virtually disable this cache. Defaults to 256 MiB.
๐ pack.deltaCacheLimit
The maximum size of a delta, that is cached in git-pack-objects(1). This cache is used to speed up the writing object phase by not having to recompute the final delta result once the best match for all objects is found. Defaults to 1000. Maximum value is 65535.
๐ฅ pack.threads
Specifies the number of threads to spawn when searching for best delta matches. This requires that git-pack-objects(1) be compiled with pthreads โ otherwise this option is ignored with a warning. โ ๏ธ This is meant to reduce packing time on multiprocessor machines. The required amount of memory for the delta search window is however multiplied by the number of threads. Specifying 0 will cause Git to auto-detect the number of CPUs and set the number of threads accordingly.
๐ pack.indexVersion
Specify the default pack index version. Valid values are 1 for legacy pack index used by Git versions prior to 1.5.2, and 2 for the new pack index with capabilities for packs larger than 4 GB as well as proper protection against the repacking of corrupted packs. Version 2 is the default. Note that version 2 is enforced and this config option is ignored whenever the corresponding pack is larger than 2 GB.
If you have an old Git that does not understand the version 2 *.idx file, cloning or fetching over a non-native protocol (e.g. "http") that will copy both *.pack file and corresponding *.idx file from the other side may give you a repository that cannot be accessed with your older version of Git. If the *.pack file is smaller than 2 GB, however, you can use git-index-pack(1) on the *.pack file to regenerate the *.idx file. slay. ๐
๐ pack.packSizeLimit
The maximum size of a pack. This setting only affects packing to a file when repacking, i.e. the git:// protocol is unaffected. It can be overridden by the --max-pack-size option of git-repack(1). Reaching this limit results in the creation of multiple packfiles.
ngl bestie, note that this option is rarely useful, and may result in a larger total on-disk size (because Git will not store deltas between packs) and worse runtime performance (object lookup within multiple packs is slower than a single pack, and optimizations like reachability bitmaps cannot cope with multiple packs). ๐
If you need to actively run Git using smaller packfiles (e.g., because your filesystem does not support large files), this option may help. But if your goal is to transmit a packfile over a medium that supports limited sizes (e.g., removable media that cannot store the whole repository), you are likely better off creating a single large packfile and splitting it using a generic multi-volume archive tool (e.g., Unix split). ๐
The minimum size allowed is limited to 1 MiB. The default is unlimited. Common unit suffixes of k, m, or g are supported.
๐ฆ pack.useBitmaps
When true, git will use pack bitmaps (if available) when packing to stdout (e.g., during the server side of a fetch). Defaults to true. You should not generally need to turn this off unless you are debugging pack bitmaps. ๐
pack.useBitmapBoundaryTraversalโ set this to true and Git busts out an experimental algorithm for computing reachability queries with bitmaps โจ. Instead of building up complete bitmaps for all the negated tips and then OR-ing them together, it treats negated tips that already have bitmaps as additive (so: OR-ing them into the result if they exist, ignoring them otherwise), and builds up a bitmap at the boundary instead. Kinda icon energy, ngl.
Heads up though: when using this algorithm, Git may include too many objects as a result of not opening up trees belonging to certain UNINTERESTING commits. That inexactness? It matches the non-bitmap traversal algorithm, so it's not a new vibe, it's the old vibe ๐.
In many cases this can give you a speed-up over the exact algorithm, particularly when there's poor bitmap coverage of the negated side of the query. Slay for performance ๐.
pack.useSparseโ when true,gitwill default to using the--sparseoption ingit pack-objectswhen the--revsoption is present ๐. This algorithm only walks trees that appear in paths that introduce new objects. That can have significant performance benefits when computing a pack to send a small change. But โ and this is the important part โ it's possible that extra objects are added to the pack-file if the included commits contain certain types of direct renames. Default istrue.pack.usePathWalkโ turn on the--path-walkoption by default forgit pack-objectsprocesses ๐ฆ. Seegit-pack-objects(1)for full details, bestie.pack.preferBitmapTipsโ specifies a ref hierarchy (e.g.,"refs/heads/"); you can give it multiple times to specify more than one hierarchy ๐ . When selecting which commits will receive bitmaps, prefer a commit at the tip of a reference that's contained in any of the configured hierarchies.
Okay so important nuance: setting this configuration to refs/foo/ does not mean the commits at the tips of refs/foo/bar and refs/foo/baz will necessarily be selected. Why? Because commits are selected for bitmaps from within a series of windows of variable length ๐.
But if a commit at the tip of any reference which is a suffix of any value of this configuration is seen in a window, it is immediately given preference over any other commit in that window. Instantly. No queue. Main character commit ๐.
pack.writeBitmaps(deprecated) โ this is a deprecated synonym forrepack.writeBitmaps. Use the other one, bestie ๐.pack.writeBitmapHashCacheโ when true,gitwill include a"hash cache"section in the bitmap index (if one is written) โจ. This cache can be used to feed git's delta heuristics, potentially leading to better deltas between bitmapped and non-bitmapped objects (e.g., when serving a fetch between an older, bitmapped pack and objects that have been pushed since the lastgc). The downside? It consumes 4 bytes per object of disk space ๐ญ. Defaults totrue.
Also, when writing a multi-pack reachability bitmap, no new namehashes are computed; instead, any namehashes stored in an existing bitmap are permuted into their appropriate location when writing a new bitmap ๐.
pack.writeBitmapLookupTableโ when true, Git will include a"lookup table"section in the bitmap index (if one is written) ๐. This table is used to defer loading individual bitmaps as late as possible. That can be beneficial in repositories that have relatively large bitmap indexes. Defaults tofalse.pack.readReverseIndexโ when true,gitwill read any.revfile(s) that may be available (see:gitformat-pack(5)) ๐. When false, the reverse index will be generated from scratch and stored in memory. Defaults totrue.pack.writeReverseIndexโ when true,gitwill write a corresponding.revfile (see:gitformat-pack(5)) for each new packfile that it writes in all places except forgit-fast-import(1)and in the bulk checkin mechanism ๐. Defaults totrue.
pager.<cmd>โ if the value is boolean, it turns pagination on or off for the output of a particular Git subcommand when writing to a tty ๐ธ. Otherwise, it turns on pagination for the subcommand using the pager specified by the value ofpager.<cmd>. If--paginateor--no-pageris specified on the command line, it takes precedence over this option โ command line always wins, periodt ๐ . And if you wanna disable pagination for all commands, setcore.pagerorGIT_PAGERtocat.pretty.<name>โ an alias for a--pretty=format string, as specified ingit-log(1)โจ. Any aliases defined here can be used just as the built-in pretty formats could. For example, running
git config pretty.changelog "format:* %H %s"
would cause the invocation git log --pretty=changelog to be equivalent to running git log "--pretty=format:* %H %s". So cute, so convenient ๐.
Watch out: an alias with the same name as a built-in format will be silently ignored ๐. No error, no warning, just vibes and your alias doing nothing.
promisor.quietโ if set to"true", assume--quietwhen fetching additional objects for a partial clone ๐คซ.promisor.advertiseโ if set to"true", a server will use the"promisor-remote"capability, seegitprotocol-v2(5), to advertise the promisor remotes it's using, if it uses some ๐ข. Default is"false", which means the"promisor-remote"capability is not advertised.promisor.sendFieldsโ a comma or space separated list of additional remote related field names ๐. A server sends these field names and the associated field values from its configuration when advertising its promisor remotes using the"promisor-remote"capability, seegitprotocol-v2(5). Currently, only the"partialCloneFilter"and"token"field names are supported ๐.partialCloneFilterโ contains the partial clone filter used for the remote.tokenโ contains an authentication token for the remote ๐.
When a field name is part of this list and a corresponding "remote.foo.<field-name>" config variable is set on the server to a non-empty value, then the field name and value are sent when advertising the promisor remote "foo" โจ.
This list has no effect unless the "promisor.advertise" config variable is set to "true", and the "name" and "url" fields are always advertised regardless of this setting ๐
.
promisor.acceptFromServerโ controls which promisor remotes advertised by a server (using the"promisor-remote"protocol capability) a client will accept ๐ค. By accepting a promisor remote, the client agrees that the server might omit objects that are lazily fetchable from this promisor remote from its responses to"fetch"and"clone"requests.
Note that this option does not cause new remotes to be automatically created in the client's configuration ๐ซถ. It only allows remotes which are somehow already configured to be trusted for the current operation, or their fields to be updated (ifpromisor.storeFieldsis set and the remote already exists locally). To allow Git to automatically create and persist new remotes from server advertisements, usepromisor.acceptFromServerUrl.
The available options are:
none(default) โ no promisor remote advertised by a server will be accepted ๐ โโ๏ธ.knownUrlโ the client will accept promisor remotes that are already configured on the client and have both the same name and the same URL as advertised by the server ๐. This is more secure thanallorknownName, and should be used if possible instead of those options.knownNameโ the client will accept promisor remotes that are already configured on the client and have the same name as those advertised by the server. This is not very secure ๐ฌ, but could be used in a corporate setup where servers and clients are trusted to not switch names and URLs.allโ the client will accept all the promisor remotes a server might advertise ๐. This is the least secure option and should only be used in fully trusted environments.
Name and URL comparisons are case-sensitive โ ๏ธ. See gitprotocol-v2(5) for protocol details.
promisor.acceptFromServerUrlโ a glob pattern to specify which server-advertised URLs a client is allowed to act on ๐. When a URL matches, the client will accept the advertised remote as a promisor remote, may automatically create a new remote configuration for it and may automatically accept field updates (such as authentication tokens) from the server โ even ifpromisor.acceptFromServeris set tonone(the default) ๐.
This option can appear multiple times in config files โจ. An advertised URL will be accepted if it matches ANY glob pattern specified by this option in ANY config file read by Git.
When both promisor.acceptFromServer and promisor.acceptFromServerUrl are set, promisor.acceptFromServerUrl is consulted first and takes precedence: if a matching pattern leads to acceptance (either by auto-configuring an unknown remote or by accepting field updates for a known remote whose URL matches both the local configuration and the allowlist), the advertised remote is accepted regardless of the promisor.acceptFromServer setting ๐ซถ. If no pattern in promisor.acceptFromServerUrl triggers acceptance, the decision is left to promisor.acceptFromServer.
But note: even when an advertised URL matches a pattern inpromisor.acceptFromServerUrl, an already-existing remote on the client whose name matches the advertised name but whose configured URL differs from the advertised one will NOT be accepted throughpromisor.acceptFromServerUrl๐ซ. This prevents a server from silently re-pointing an existing client-side remote at a different URL. (Such a remote may still be accepted throughpromisor.acceptFromServer=allor=knownName, which have their own, looser semantics; see the documentation of that option.)
Be VERY careful with these patterns ๐ญ: * matches any sequence of characters within the host and path parts of a URL (but cannot cross part boundaries). An overly broad pattern is a major security risk, as a matching URL allows a server to auto-configure new remotes and to update fields (such as authentication tokens) on known remotes without further confirmation ๐๐๐. To minimize security risks, follow these guidelines:
- Start with a secure protocol scheme, like
https://orssh://๐. - Only allow domain names or paths where you control and trust ALL the content. Be especially careful with shared hosting platforms like
github.comorgitlab.comโ ๏ธ. A broad pattern likehttps://gitlab.com/*is dangerous because it trusts every single repository on the entire platform. Always restrict such patterns to your specific organization or namespace (e.g.,https://gitlab.com/your-org/*) ๐ .
- Never put globs at the end of a domain name, bestie. Like
https://cdn.your-org.com/*is probably fine, buthttps://cdn.your-org.com*/*is a major security risk because that second one straight-up matcheshttps://cdn.your-org.com.hacker.net/repo. ๐ - Be careful with globs at the beginning of domain names too. The code does make sure a
*in the host can't cross over into the path, but a pattern likehttps://*.example.com/*will still match any subdomain. That's extremely dangerous on shared hosting platforms (e.g.https://*.github.io/*ends up trusting every single user's site on the whole platform ๐).
Before matching happens, both the advertised URL and the pattern get normalized: the scheme and host are lowercased, percent-encoded characters are decoded where possible, and path segments like .. are resolved. The port has to match exactly too (so https://example.com:8080/* will not match a URL advertised on port 9999). The username and password components of the URL are ignored during matching. Btw, embedding credentials in URLs is discouraged โ passing authentication tokens via the token field of the promisor-remote capability is strongly preferred. ๐ซถ
The glob pattern can optionally be prefixed with a remote name and an equals sign (e.g. cdn=https://cdn.example.com/*). If you do give it a prefix, the accepted remotes get saved under that name. If you don't, a safe remote name is automatically generated by sanitizing the URL and prefixing it with promisor-auto-.
If a remote with the chosen name already exists but points to a different URL, Git will append a numeric suffix (e.g. -1, -2) to the name so it doesn't overwrite your existing configs. You should make sure that doesn't happen often though, because remotes get rejected if the numeric suffix increases too much. In all cases, the original name advertised by the server is recorded in the remote.<name>.advertisedAs configuration variable, for tracing and debugging purposes. ๐
For the security implications of accepting a promisor remote, see the documentation of promisor.acceptFromServer. For details on the protocol, see gitprotocol-v2(5).
promisor.checkFieldsโ a comma or space separated list of extra remote-related field names. A client checks whether the values of these fields transmitted by a server correspond to the values of these fields in its own configuration before accepting a promisor remote. Currently,"partialCloneFilter"and"token"are the only supported field names. โจ
If one of these field names (e.g. "token") is being checked for an advertised promisor remote (e.g. "foo"), three conditions must be met for the check of this specific field to pass:
- The corresponding local configuration (e.g.
remote.foo.token) must be set. - The server must advertise the
"token"field for remote"foo". - The value of the locally configured
remote.foo.tokenmust exactly match the value advertised by the server for the"token"field.
If any of these conditions isn't met for any field name listed in promisor.checkFields, the advertised remote "foo" is rejected. ๐ซ
For the "partialCloneFilter" field, this lets the client make sure the server's filter matches what it expects locally, preventing inconsistencies in filtering behavior. For the "token" field, this can be used to verify that authentication credentials match expected values.
Field values are compared case-sensitively. ๐
The "name" and "url" fields are always checked according to the promisor.acceptFromServer policy, independently of this setting.
The field names and values should be passed by the server through the "promisor-remote" capability by using the promisor.sendFields config variable. Fields are checked only if the promisor.acceptFromServer config variable is not set to "None". If set to "None", this config variable has no effect. See gitprotocol-v2(5).
promisor.storeFieldsโ a comma or space separated list of extra remote-related field names. If a client accepts an advertised remote, the client will store the values associated with these field names (taken from the remote advertisement) into its configuration, and then reload its remote configuration. Currently,"partialCloneFilter"and"token"are the only supported field names. ๐
For example, if a server advertises "partialCloneFilter=blob:limit=20k" for remote "foo", and that remote is accepted, then "blob:limit=20k" will be stored for the "remote.foo.partialCloneFilter" configuration variable.
If the new field value from an advertised remote is the same as the existing field value for that remote on the client side, then no change is made to the client configuration though.
When a new value is stored, a message is printed to standard error so users know about it. ๐ข
Note that for security reasons, if the remote isn't already configured on the client side, nothing will be stored for that remote. In any case, no new remote will be created and no URL will be stored. ๐ โโ๏ธ
Before storing a partial clone filter, it's parsed to check it's valid. If it's not, a warning is emitted and it's not stored.
Before storing a token, a check is performed to make sure it contains no control character. If the check fails, a warning is emitted and it's not stored.
protocol.allowโ if set, gives a user defined default policy for all protocols that don't explicitly have a policy (protocol.<name>.allow). By default, if unset, known-safe protocols (http,https,git,ssh) have a default policy ofalways, known-dangerous protocols (ext) have a default policy ofnever, and all other protocols (includingfile) have a default policy ofuser. Supported policies: ๐alwaysโ protocol is always able to be used. โneverโ protocol is never able to be used. โuserโ protocol is only able to be used whenGIT_PROTOCOL_FROM_USERis either unset or has a value of1. This policy should be used when you want a protocol to be directly usable by the user but don't want it used by commands which execute clone/fetch/push commands without user input, e.g. recursive submodule initialization.
protocol.<name>.allowโ sets a policy to be used by protocol <name> with clone/fetch/push commands. Seeprotocol.allowabove for the available policies.
The protocol names currently used by git are:
file: any local file-based path (includingfile://URLs, or local paths)git: the anonymous git protocol over a direct TCP connection (or proxy, if configured)ssh: git over ssh (includinghost:pathsyntax,ssh://, etc).http: git over http, both "smart http" and "dumb http". Note that this does not includehttps; if you want to configure both, you must do so individually. ๐ซ- any external helpers are named by their protocol (e.g., use
hgto allow thegit-remote-hghelper)
protocol.versionโ if set, clients will attempt to communicate with a server using the specified protocol version. If the server doesn't support it, communication falls back to version0. If unset, the default is2. Supported versions: ๐ฆ0โ the original wire protocol.1โ the original wire protocol with the addition of a version string in the initial response from the server.2โ Wire protocol version 2, seegitprotocol-v2(5).
pull.ffโ by default, Git does not create an extra merge commit when merging a commit that is a descendant of the current commit. Instead, the tip of the current branch is fast-forwarded. When set tofalse, this variable tells Git to create an extra merge commit in such a case (equivalent to giving the--no-ffoption from the command line). When set toonly, only such fast-forward merges are allowed (equivalent to giving the--ff-onlyoption from the command line). This setting overridesmerge.ffwhen pulling. โญpull.rebaseโ whentrue, rebase branches on top of the fetched branch, instead of merging the default branch from the default remote whengit pullis run. See"branch.<name>.rebase"for setting this on a per-branch basis. ๐ง
When merges (or just m), pass the --rebase-merges option to git rebase so that the local merge commits are included in the rebase (see git-rebase(1) for details).
When the value is interactive (or just i), the rebase is run in interactive mode.
NOTE: this is a possibly dangerous operation; do not use it unless you understand the implications (see git-rebase(1) for details). ๐ญ
pull.octopusโ the default merge strategy to use when pulling multiple branches at once.pull.autoStashโ when set totrue, automatically create a temporary stash entry to record the local changes before the operation begins, and restore them after the operation completes. When yourgit pullrebases (instead of merges), this may be convenient, since unlike merging pull that tolerates local changes that don't interfere with the merge, rebasing pull refuses to work with any local changes. ๐
If pull.autostash is set (either to true or false), merge.autostash and rebase.autostash are ignored. If pull.autostash is not set at all, depending on the value of pull.rebase, merge.autostash or rebase.autostash is used instead. Can be overridden by the --[no-]autostash command line option.
pull.twoheadโ the default merge strategy to use when pulling a single branch.push.autoSetupRemoteโ if set totrue, assume--set-upstreamon default push when no upstream tracking exists for the current branch; this option takes effect withpush.defaultoptionssimple,upstream, andcurrent. It's useful if by default you want new branches pushed to the default remote (like the behavior ofpush.default=current) and you also want the upstream tracking to be set. Workflows most likely to benefit from this option are simple central workflows where all branches are expected to have the same name on the remote. ๐ฅ
push.default
Bestie, this one decides what git push actually does when you don't hand it a refspec โ like, no refspec from the command line, from config, from anywhere. Different values are built for different workflows; for example, in a purely central workflow (where the fetch source equals the push destination ngl) upstream is probably what you want. Possible values are:
nothingโ literally do not push anything (error out) unless a refspec is given. This is primarily meant for people who want to avoid mistakes by always being explicit. Respect the paranoia honestly ๐currentโ push the current branch to update a branch with the same name on the receiving end. Works in both central and non-central workflows, versatile queen.upstreamโ push the current branch back to the branch whose changes are usually integrated into the current branch (which is called@{upstream}). This mode only makes sense if you're pushing to the same repository you'd normally pull from (i.e. central workflow).trackingโ this is a deprecated synonym forupstream. She's old, she's tired ๐simpleโ push the current branch with the same name on the remote.- This mode requires that the remote repository to be pushed to is known. When pushing back to the same remote you pull from, the current branch must also have an upstream tracking branch with the same name.
- This mode is the default since Git 2.0, and is the safest option suited for beginners. Beginner-friendly icon โจ
matchingโ push all branches having the same name on both ends. This makes the repository you're pushing to remember the set of branches that will be pushed out (e.g. if you always pushmaintandmasterthere and no other branches, the repository you push to will have these two branches, and your localmaintandmasterwill be pushed there).- To use this mode effectively, you have to make sure all the branches you would push out are ready to be pushed out before running
git push, because the whole point of this mode is to allow you to push all of the branches in one go. If you usually finish work on only one branch and push out the result while other branches are unfinished, this mode is not for you ๐ - Also this mode is not suitable for pushing into a shared central repository, since other people may add new branches there, or update the tip of existing branches outside your control.
- This used to be the default, but not since Git 2.0 (
simpleis the new default).
- To use this mode effectively, you have to make sure all the branches you would push out are ready to be pushed out before running
push.followTags
If set to true, enable the --follow-tags option by default. You may override this configuration at time of push by specifying --no-follow-tags. Override whenever, no drama ๐ซถ
push.gpgSign
May be set to a boolean value, or the string if-asked. A true value causes all pushes to be GPG signed, as if --signed is passed to git-push(1). The string if-asked causes pushes to be signed if the server supports it, as if --signed=if-asked is passed to git push. A false value may override a value from a lower-priority config file. An explicit command-line flag always overrides this config option โ command line stays main character ๐
push.pushOption
When no --push-option=<option> argument is given from the command line, git push behaves as if each <option> of this variable is given as --push-option=<option>.
This is a multi-valued variable, and an empty value can be used in a higher priority configuration file (e.g. .git/config in a repository) to clear the values inherited from lower priority configuration files (e.g. $HOME/.gitconfig).
Example:
/etc/gitconfig
push.pushoption = a
push.pushoption = b
~/.gitconfig
push.pushoption = c
repo/.git/config
push.pushoption =
push.pushoption = b
This will result in only b (a and c are cleared). Clean slate energy โจ
push.recurseSubmodules
May be check, on-demand, only, or no, with the same behavior as that of push --recurse-submodules. If not set, no is used by default, unless submodule.recurse is set (in which case a true value means on-demand).
push.useForceIfIncludes
If set to true, it is equivalent to specifying --force-if-includes as an option to git-push(1) in the command line. Adding --no-force-if-includes at the time of push overrides this configuration setting.
push.negotiate
If set to true, attempt to reduce the size of the packfile sent by rounds of negotiation in which the client and the server attempt to find commits in common. If false, Git will rely solely on the server's ref advertisement to find commits in common.
push.useBitmaps
If set to false, disable use of bitmaps for git push even if pack.useBitmaps is true, without preventing other git operations from using bitmaps. Default is true.
rebase.backend
Default backend to use for rebasing. Possible choices are apply or merge. In the future, if the merge backend gains all remaining capabilities of the apply backend, this setting may become unused. Future tea ๐ต
rebase.stat
Whether to show a diffstat of what changed upstream since the last rebase. False by default.
rebase.autoSquash
If set to true, enable the --autosquash option of git-rebase(1) by default for interactive mode. This can be overridden with the --no-autosquash option.
rebase.autoStash
When set to true, automatically create a temporary stash entry before the operation begins, and apply it after the operation ends. This means that you can run rebase on a dirty worktree. However, use with care: the final stash application after a successful rebase might result in non-trivial conflicts ๐ญ This option can be overridden by the --no-autostash and --autostash options of git-rebase(1). Defaults to false.
rebase.updateRefs
If set to true enable --update-refs option by default.
rebase.missingCommitsCheck
If set to "warn", git rebase -i will print a warning if some commits are removed (e.g. a line was deleted), however the rebase will still proceed. If set to "error", it will print the previous warning and stop the rebase; git rebase --edit-todo can then be used to correct the error. If set to "ignore", no checking is done. To drop a commit without warning or error, use the drop command in the todo list. Defaults to "ignore".
rebase.instructionFormat
A format string, as specified in git-log(1), to be used for the todo list during an interactive rebase. The format will automatically have the commit hash prepended to the format.
rebase.abbreviateCommands
If set to true, git rebase will use abbreviated command names in the todo list resulting in something like this:
p deadbee The oneline of the commit
p fa1afe1 The oneline of the next commit
...
instead of:
pick deadbee The oneline of the commit
pick fa1afe1 The oneline of the next commit
...
Defaults to false. Short and sweet, lowkey efficient ๐
rebase.rescheduleFailedExec
Automatically reschedule exec commands that failed. This only makes sense in interactive mode (or when an --exec option was provided). This is the same as specifying the --reschedule-failed-exec option.
rebase.forkPoint
If set to false set --no-fork-point option by default.
rebase.rebaseMerges
Whether and how to set the --rebase-merges option by default. Can be rebase-cousins, no-rebase-cousins, or a boolean. Setting to true or to no-rebase-cousins is equivalent to --rebase-merges=no-rebase-cousins, setting to rebase-cousins is equivalent to --rebase-merges=rebase-cousins, and setting to false is equivalent to --no-rebase-merges. Passing --rebase-merges on the command line, with or without an argument, overrides any rebase.rebaseMerges configuration.
rebase.maxLabelLength
When generating label names from commit subjects, truncate the names to this length. By default, the names are truncated to a little less than NAME_MAX (to allow e.g. .lock files to be written for the corresponding loose refs).
receive.advertiseAtomic
By default, git-receive-pack will advertise the atomic push capability to its clients. If you don't want to advertise this capability, set this variable to false.
receive.advertisePushOptions
When set to true, git-receive-pack will advertise the push options capability to its clients. False by default.
receive.autogc
By default, git-receive-pack will run "git maintenance run --auto" after receiving data from git-push and updating refs. You can stop it by setting this variable to false.
receive.certNonceSeed
By setting this variable to a string, git receive-pack will accept a git push --signed and verify it by using a "nonce" protected by HMAC using this string as a secret key. Secret key behaviour ๐ฅ
receive.certNonceSlop
When a git push --signed sends a push certificate with a "nonce" that was issued by a receive-pack serving the same repository within this many seconds, export the "nonce" found in the certificate to GIT_PUSH_CERT_NONCE to the hooks (instead of what the receive-pack asked the sending side to include). This may allow writing checks in pre-receive and post-receive a bit easier. Instead of checking GIT_PUSH_CERT_NONCE_SLOP environment variable that records by how many seconds the nonce is stale to decide if they want to accept the certificate, they only can check GIT_PUSH_CERT_NONCE_STATUS is OK.
receive.fsckObjects
If it is set to true, git-receive-pack will check all received objects. See transfer.fsckObjects for what's checked. Defaults to false. If not set, the value of transfer.fsckObjects is used instead.
receive.fsck.<msg-id>
Acts like fsck.<msg-id>, but is used by git-receive-pack(1) instead of git-fsck(1). See the fsck.<msg-id> documentation for details.
receive.fsck.skipList
Acts like fsck.skipList, but is used by git-receive-pack(1) instead of git-fsck(1). See the fsck.skipList documentation for details.
Okay bestie, this next lil cluster is all about the receive side of push, the reftable backend, and the remote config glow-up. It's giving server-side details, but make it cute. ๐
๐ receive.keepAlive
After the pack from the client arrives, receive-pack may produce no output (if --quiet was specified) while it processes the pack, and some networks will straight-up drop the TCP connection because of the silence. With this option set, if receive-pack does not transmit any data in this phase for receive.keepAlive seconds, it will send a short keepalive packet. The default is 5 seconds; set to 0 to disable keepalives entirely.
๐ receive.unpackLimit
If the number of objects received in a push is below this limit, then the objects will be unpacked into loose object files. However if the number of received objects equals or exceeds this limit, then the received pack will be stored as a pack, after adding any missing delta bases. Storing the pack from a push can make the push operation complete faster, especially on slow filesystems. If not set, the value of transfer.unpackLimit is used instead.
โจ receive.maxInputSize
If the size of the incoming pack stream is larger than this limit, then git-receive-pack will error out, instead of accepting the pack file. If not set or set to 0, then the size is unlimited.
๐ฆ receive.denyDeletes
If set to true, git-receive-pack will deny a ref update that deletes the ref. Use this to prevent such a ref deletion via a push.
๐ธ receive.denyDeleteCurrent
If set to true, git-receive-pack will deny a ref update that deletes the currently checked out branch of a non-bare repository.
๐ receive.denyCurrentBranch
If set to true or "refuse", git-receive-pack will deny a ref update to the currently checked out branch of a non-bare repository. Such a push is potentially dangerous because it brings the HEAD out of sync with the index and working tree. If set to "warn", print a warning of such a push to stderr, but allow the push to proceed. If set to false or "ignore", allow such pushes with no message. Defaults to "refuse".
Another option is "updateInstead" which will update the working tree if pushing into the current branch. This option is intended for synchronizing working directories when one side is not easily accessible via interactive ssh (e.g. a live web site, hence the requirement that the working directory be clean). This mode also comes in handy when developing inside a VM to test and fix code on different Operating Systems.
By default, "updateInstead" will refuse the push if the working tree or the index have any difference from the HEAD, but the push-to-checkout hook can be used to customize this. See githooks(5).
๐ฅ receive.denyNonFastForwards
If set to true, git-receive-pack will deny a ref update which is not a fast-forward. Use this to prevent such an update via a push, even if that push is forced. This configuration variable is set when initializing a shared repository.
๐ง receive.hideRefs
This variable is the same as transfer.hideRefs, but applies only to receive-pack (and so affects pushes, but not fetches). An attempt to update or delete a hidden ref by git push is rejected.
๐ receive.procReceiveRefs
This is a multi-valued variable that defines reference prefixes to match the commands in receive-pack. Commands matching the prefixes will be executed by an external hook "proc-receive", instead of the internal execute_commands function. If this variable is not defined, the "proc-receive" hook will never be used, and all commands will be executed by the internal execute_commands function.
For example, if this variable is set to "refs/for", pushing to reference such as "refs/for/master" will not create or update a reference named "refs/for/master", but may create or update a pull request directly by running the hook "proc-receive".
Optional modifiers can be provided in the beginning of the value to filter commands for specific actions: create (a), modify (m), delete (d). A ! can be included in the modifiers to negate the reference prefix entry. E.g.:
git config --system --add receive.procReceiveRefs ad:refs/heads
git config --system --add receive.procReceiveRefs !:refs/heads
๐ receive.updateServerInfo
If set to true, git-receive-pack will run git-update-server-info after receiving data from git-push and updating refs.
๐ receive.shallowUpdate
If set to true, .git/shallow can be updated when new refs require new shallow roots. Otherwise those refs are rejected.
๐ reftable.blockSize
The size in bytes used by the reftable backend when writing blocks. The block size is determined by the writer, and does not have to be a power of 2. The block size must be larger than the longest reference name or log entry used in the repository, as references cannot span blocks.
Powers of two that are friendly to the virtual memory system or filesystem (such as 4kB or 8kB) are recommended. Larger sizes (64kB) can yield better compression, with a possible increased cost incurred by readers during access.
The largest block size is 16777215 bytes (15.99 MiB). The default value is 4096 bytes (4kB). A value of 0 will use the default value.
๐ซถ reftable.restartInterval
The interval at which to create restart points. The reftable backend determines the restart points at file creation. Every 16 may be more suitable for smaller block sizes (4k or 8k), every 64 for larger block sizes (64k).
More frequent restart points reduces prefix compression and increases space consumed by the restart table, both of which increase file size.
Less frequent restart points makes prefix compression more effective, decreasing overall file size, with increased penalties for readers walking through more records after the binary search step.
A maximum of 65535 restart points per block is supported.
The default value is to create restart points every 16 records. A value of 0 will use the default value.
โญ reftable.indexObjects
Whether the reftable backend shall write object blocks. Object blocks are a reverse mapping of object ID to the references pointing to them.
The default value is true.
๐ฆ reftable.geometricFactor
Whenever the reftable backend appends a new table to the stack, it performs auto compaction to ensure that there is only a handful of tables. The backend does this by ensuring that tables form a geometric sequence regarding the respective sizes of each table.
By default, the geometric sequence uses a factor of 2, meaning that for any table, the next-biggest table must at least be twice as big. A maximum factor of 256 is supported.
๐ธ reftable.lockTimeout
Whenever the reftable backend appends a new table to the stack, it has to lock the central "tables.list" file before updating it. This config controls how long the process will wait to acquire the lock in case another process has already acquired it. Value 0 means not to retry at all; -1 means to try indefinitely. Default is 100 (i.e., retry for 100ms).
๐ remote.pushDefault
The remote to push to by default. Overrides branch.<name>.remote for all branches, and is overridden by branch.<name>.pushRemote for specific branches.
๐ remote.<name>.url
The URL of a remote repository. See git-fetch(1) or git-push(1). A configured remote can have multiple URLs; in this case the first is used for fetching, and all are used for pushing (assuming no remote.<name>.pushurl is defined). Setting this key to the empty string clears the list of urls, allowing you to override earlier config.
โจ remote.<name>.pushurl
The push URL of a remote repository. See git-push(1). If a pushurl option is present in a configured remote, it is used for pushing instead of remote.<name>.url. A configured remote can have multiple push URLs; in this case a push goes to all of them. Setting this key to the empty string clears the list of urls, allowing you to override earlier config.
๐ฆ remote.<name>.proxy
For remotes that require curl (http, https and ftp), the URL to the proxy to use for that remote. Set to the empty string to disable proxying for that remote.
๐ธ remote.<name>.proxyAuthMethod
For remotes that require curl (http, https and ftp), the method to use for authenticating against the proxy in use (probably set in remote.<name>.proxy). See http.proxyAuthMethod.
๐
remote.<name>.fetch
The default set of "refspec" for git-fetch(1). See git-fetch(1).
๐ฅ remote.<name>.push
The default set of "refspec" for git-push(1). See git-push(1).
๐ remote.<name>.mirror
If true, pushing to this remote will automatically behave as if the --mirror option was given on the command line.
๐ง remote.<name>.skipDefaultUpdate
A deprecated synonym to remote.<name>.skipFetchAll (if both are set in the configuration files with different values, the value of the last occurrence will be used).
๐ remote.<name>.skipFetchAll
If true, this remote will be skipped when updating using git-fetch(1), the update subcommand of git-remote(1), and ignored by the prefetch task of git maintenance.
๐ remote.<name>.receivepack
The default program to execute on the remote side when pushing. See option --receive-pack of git-push(1).
๐ remote.<name>.uploadpack
The default program to execute on the remote side when fetching. See option --upload-pack of git-fetch-pack(1).
โญ remote.<name>.tagOpt
Setting this value to --no-tags disables automatic tag following when fetching from remote <name>. Setting it to --tags will fetch every tag from remote <name>, even if they are not reachable from remote branch heads. Passing these flags directly to git-fetch(1) can override this setting. See options --tags and --no-tags of git-fetch(1).
๐ซถ remote.<name>.vcs
Setting this to a value <vcs> will cause Git to interact with the remote with the git-remote-<vcs> helper.
๐ remote.<name>.prune
When set to true, fetching from this remote by default will also remove any remote-tracking references that no longer exist on the remote (as if the --prune option was given on the command line). Overrides fetch.prune settings, if any.
๐ remote.<name>.pruneTags
When set to true, fetching from this remote by default will also remove any local tags that no longer exist on the remote if pruning is activated in general via remote.<name>.prune, fetch.prune or --prune. Overrides fetch.pruneTags settings, if any.
See also remote.<name>.prune and the PRUNING section of git-fetch(1). ๐ฆ
remote.<name>.promisorโ set this totrueand this remote gets to be the one that fetches your promisor objects. That's its whole job, bestie ๐remote.<name>.advertisedAsโ okay so when a promisor remote gets auto-configured using info a server advertised through the promisor-remote protocol capability (peeppromisor.acceptFromServerUrl), the name the server originally advertised gets stashed in this variable. It's for information, tracing and debugging purposes only, so like... look but don't touch ๐ users shouldn't typically be modifying or creating these config entries.remote.<name>.partialclonefilterโ the filter that gets applied when fetching from this promisor remote. Changing it or clearing it only affects fetches for new commits, so if you wanna grab the associated objects for commits that are already chilling in your local object database, use the--refetchoption ofgit-fetch(1). no cap โจremote.<name>.serverOptionโ the default set of server options used when fetching from this remote. These can be overridden by the--server-option=command line arguments, so the CLI is always the main character ๐
It's a multi-valued variable, and an empty value is allowed in a higher priority configuration file (e.g. .git/config in a repository) to clear out the values inherited from lower priority configuration files (e.g. $HOME/.gitconfig). reset era ๐
remote.<name>.negotiationRestrictโ when negotiating with this remote duringgit fetch, this restricts the commits advertised as"have"lines to only those reachable from refs matching the given patterns. Multi-valued, and it behaves exactly like--negotiation-restricton the command line.
Each value is either an exact ref name (e.g. refs/heads/release) or a glob pattern (e.g. refs/heads/release/*). The pattern syntax is the same as for --negotiation-restrict.
These config values are used as defaults for the --negotiation-restrict command-line option โ so if --negotiation-restrict (or its synonym --negotiation-tip) is specified on the command line, the config values are not used. periodt ๐
These values also influence negotiation during git push if push.negotiate is enabled.
Blank values signal to ignore all previous values, which lets you reset the list from broader config scenarios. so iconic ๐ธ
remote.<name>.negotiationIncludeโ when negotiating with this remote duringgit fetch, the client advertises a list of commits that exist locally. In repos with many references, that list of"haves"can get truncated, and depending on the data shape, dropping certain references may be expensive ๐ญ This multi-valued config option specifies references, commit hashes, or ref pattern globs whose tips should always be sent as"have"commits during fetch negotiation with this remote.
Each value is either an exact ref name (e.g. refs/heads/release), a commit hash, or a glob pattern (e.g. refs/heads/release/*). The pattern syntax is the same as for --negotiation-include.
These config values are used as defaults for the --negotiation-include command-line option. If --negotiation-include is specified on the command line, then the config values are not used.
This option is additive with the normal negotiation process: the negotiation algorithm still runs and advertises its own selected commits, but the refs matching remote.<name>.negotiationInclude are sent unconditionally on top of those heuristically selected commits. like, extra on purpose ๐
These values also influence negotiation during git push if push.negotiate is enabled.
Blank values signal to ignore all previous values, allowing a reset of the list from broader config scenarios. ๐
remote.<name>.followRemoteHEADโ when fetching this remote using its default refspec, this setting decides how to handle differences between the remote'sHEADand the localremotes/<name>/HEADsymbolic-ref. It overrides the value offetch.followRemoteHEADโ seefetch.followRemoteHEADfor a description of the accepted values.
On top of the values supported by fetch.followRemoteHEAD, this setting may also take on the value "warn-if-not-$branch", which behaves like "warn", but ignores the warning if the remote's HEAD is remotes/<name>/$branch. picky but polite ๐ง
remotes.<group>โ the list of remotes that get fetched bygit remote update <group>. Seegit-remote(1). ๐ซถrepack.useDeltaBaseOffsetโ by default,git-repack(1)creates packs that use delta-base offset. If you need to share your repository with Git older than version1.4.4โ either directly or via a dumb protocol such ashttpโ then you need to set this option to"false"and repack. Access from old Git versions over the native protocol is unaffected by this option, so no stress there ๐repack.packKeptObjectsโ if set totrue, makesgit repackact as if--pack-kept-objectswas passed. Seegit-repack(1)for details. Defaults tofalsenormally, buttrueif a bitmap index is being written (either via--write-bitmap-indexorrepack.writeBitmaps). โญrepack.useDeltaIslandsโ if set totrue, makesgit repackact as if--delta-islandswas passed. Defaults tofalse. ๐repack.writeBitmapsโ whentrue, git will write a bitmap index when packing all objects to disk (e.g., whengit repack -ais run). This index can speed up the"counting objects"phase of subsequent packs created for clones and fetches, at the cost of some disk space and extra time spent on the initial repack. It has no effect if multiple packfiles are created. Defaults totrueon bare repos,falseotherwise. trade-offs, bestie ๐repack.updateServerInfoโ if set tofalse,git-repack(1)will not rungit-update-server-info(1). Defaults totrue. Can be overridden whentrueby the-noption ofgit-repack(1).repack.cruftWindow,repack.cruftWindowMemory,repack.cruftDepth,repack.cruftThreadsโ parameters used bygit-pack-objects(1)when generating a cruft pack, used whenever the respective parameters are not given over the command line. See the similarly namedpack.*configuration variables for defaults and meaning. ๐repack.midxMustContainCruftโ when set totrue,git-repack(1)will unconditionally include cruft pack(s), if any, in the multi-pack index when invoked with--write-midx. Whenfalse, cruft packs are only included in the MIDX when necessary (e.g., because they might be required to form a reachability closure with MIDX bitmaps). Defaults totrue. ๐repack.midxSplitFactorโ the factor used in the geometric merging condition when compacting incremental MIDX layers duringgit repackwhen invoked with the--write-midx=incrementaloption.
Adjacent layers are merged when the accumulated object count of the newer layer exceeds 1/<N> of the object count of the next deeper layer. Must be at least 2. Defaults to 2. math girlie hours ๐งฎโจ
repack.midxNewLayerThresholdโ the minimum number of packs in the tip MIDX layer before those packs are considered as candidates for geometric repacking duringgit repack --write-midx=incremental.
When the tip layer has fewer packs than this threshold, those packs are excluded from the geometric repack entirely, and are thus left unmodified. Must be at least 1. Defaults to 8. ๐
replay.refActionโ specifies the default mode for handling reference updates. The value can be:updateโ (default) update refs directly using an atomic transaction. ๐printโ outputupdate-refcommands for pipeline use. ๐
See --ref-action in git-replay(1) for details.
rerere.autoUpdateโ when set totrue,git-rerereupdates the index with the resulting contents after it cleanly resolves conflicts using previously recorded resolutions. Defaults tofalse. she remembers so you don't have to ๐ญ๐rerere.enabledโ activates recording of resolved conflicts, so that identical conflict hunks can be resolved automatically should they ever be encountered again. By default,git-rerere(1)is enabled if there's anrr-cachedirectory under the$GIT_DIRโ e.g. if"rerere"was previously used in the repository. iconic behaviour fr fr ๐revert.referenceโ setting this variable totruemakesgit revertbehave as if the--referenceoption is given. ๐ธsafe.bareRepositoryโ specifies which bare repositories Git will work with. The currently supported values are:all: Git works with all bare repositories. This is the default in Git 2.x.explicit: Git only works with bare repositories specified via the top-level--git-dircommand-line option, or theGIT_DIRenvironment variable (seegit(1)). This will be the default in Git 3.0. ๐ฅ
If you don't use bare repositories in your workflow, then it may be beneficial to set safe.bareRepository to explicit in your global config. This protects you from attacks that involve cloning a repository that contains a bare repository and running a Git command within that directory. ๐ก๏ธโจ
If you do use bare repositories regularly and want to preserve the current behavior after upgrading to Git 3.0, set safe.bareRepository to all in your global or system config.
heads up bestie: this config setting is only respected in protected configuration (see the section called "SCOPES"). This prevents untrusted repositories from tampering with this value. don't skip this one ๐
safe.directoryโ these config entries specify Git-tracked directories that are considered safe even if they're owned by someone other than the current user. By default, Git will refuse to even parse a Git config of a repository owned by someone else, let alone run its hooks โ and this config setting lets users specify exceptions, e.g. for intentionally shared repositories (see the--sharedoption ingit-init(1)). ๐ค
It's a multi-valued setting, i.e. you can add more than one directory via git config --add. To reset the list of safe directories (e.g. to override any such directories specified in the system config), add a safe.directory entry with an empty value. clean slate energy ๐ซง
again: this config setting is only respected in protected configuration (see the section called "SCOPES"). This prevents untrusted repositories from tampering with this value. ๐
The value of this setting is interpolated, i.e. ~/<path> expands to a path relative to the home directory and %(prefix)/<path> expands to a path relative to Git's (runtime) prefix. ๐ง๐
- To completely opt out of this security check, set
safe.directoryto the string*. That's it, that's the whole vibe โ every repo gets treated as if its directory was chill and listed in thesafe.directorylist. โจ But heads up, bestie: ifsafe.directory=*is set in system config and you actually want to re-enable this protection, then initialize your list with an empty value before listing the repositories that you deem safe. And giving a directory with/*appended to it will allow access to all repositories under the named directory. ๐
So, as explained, Git only allows you to access repositories owned by yourself, i.e. the user who is running Git, by default. No cap. But: when Git is running as root in a non Windows platform that provides sudo, git checks the SUDO_UID environment variable that sudo creates and will allow access to the uid recorded as its value in addition to the id from root. Why? Because it makes it easy to perform a common sequence during installation "make && sudo make install". ๐ A git process running under sudo runs as root but the sudo command exports the environment variable to record which id the original user has. If that is not what you would prefer and you want git to only trust repositories that are owned by root instead, then you can remove the SUDO_UID variable from root's environment before invoking git. ๐
๐ CONFIGURATION FILE (still going, we're so back)
sendemail.identity
A configuration identity. When given, causes values in the sendemail.<identity> subsection to take precedence over values in the sendemail section. The default identity is the value of sendemail.identity. ๐
sendemail.smtpEncryption
See git-send-email(1) for description. Note that this setting is not subject to the identity mechanism. (iconic of it, honestly)
sendemail.smtpSSLCertPath
Path to ca-certificates (either a directory or a single file). Set it to an empty string to disable certificate verification. ๐ฆ
sendemail.smtpSSLClientCert
Path to the client certificate file to present if requested by the server. This is required when the server is set up to verify client certificates. If the corresponding private key is not included in the file, it must be supplied using sendemail.smtpSSLClientKey or the --smtp-ssl-client-key option.
sendemail.smtpSSLClientKey
Path to the client private key file that corresponds to the client certificate. To avoid misconfiguration, this configuration must be used in conjunction with sendemail.smtpSSLClientCert or the --smtp-ssl-client-cert option. If the client key is included in the client certificate, the choice of private key depends on the format of the certificate. Visit https://metacpan.org/pod/IO::Socket::SSL for more details. ๐ฅ
sendemail.<identity>.<config>
Identity-specific versions of the sendemail.<config> parameters found below, taking precedence over those when this identity is selected, through either the command-line or sendemail.identity. It's giving layered outfits, but for config. ๐
sendemail.multiEdit
If true (default), a single editor instance will be spawned to edit files you have to edit (patches when --annotate is used, and the summary when --compose is used). If false, files will be edited one after the other, spawning a new editor each time. ๐ญ (chaotic but valid)
sendemail.confirm
Sets the default for whether to confirm before sending. Must be one of always, never, cc, compose, or auto. See --confirm in the git-send-email(1) documentation for the meaning of these values. โญ
sendemail.mailmap
If true, makes git-send-email(1) assume --mailmap, otherwise assume --no-mailmap. False by default. ๐
sendemail.mailmap.file
The location of a git-send-email(1) specific augmenting mailmap file. The default mailmap and mailmap.file are loaded first. Thus, entries in this file take precedence over entries in the default mailmap locations. See gitmailmap(5). ๐
sendemail.mailmap.blob
Like sendemail.mailmap.file, but consider the value as a reference to a blob in the repository. Entries in sendemail.mailmap.file take precedence over entries here. See gitmailmap(5).
sendemail.aliasesFile
To avoid typing long email addresses, point this to one or more email aliases files. You must also supply sendemail.aliasFileType. (both of them, bestie, it's a package deal ๐ซถ)
sendemail.aliasFileType
Format of the file(s) specified in sendemail.aliasesFile. Must be one of mutt, mailrc, pine, elm, gnus, or sendmail.
What an alias file in each format looks like can be found in the documentation of the email program of the same name. The differences and limitations from the standard formats are described below:
sendmail
- Quoted aliases and quoted addresses are not supported: lines that contain a
"symbol are ignored. ๐ - Redirection to a file (
/path/name) or pipe (|command) is not supported. - File inclusion (
:include: /path/name) is not supported. - Warnings are printed on the standard error output for any explicitly unsupported constructs, and any other lines that are not recognized by the parser.
sendemail.annotate, sendemail.bcc, sendemail.cc, sendemail.ccCmd, sendemail.chainReplyTo, sendemail.envelopeSender, sendemail.from, sendemail.headerCmd, sendemail.signedOffByCc, sendemail.smtpPass, sendemail.suppressCc, sendemail.suppressFrom, sendemail.to, sendemail.toCmd, sendemail.smtpDomain, sendemail.smtpServer, sendemail.smtpServerPort, sendemail.smtpServerOption, sendemail.smtpUser, sendemail.imapSentFolder, sendemail.useImapOnly, sendemail.thread, sendemail.transferEncoding, sendemail.validate, sendemail.xmailer
These configuration variables all provide a default for git-send-email(1) command-line options. See its documentation for details. Yes, all of them. One giant squad. ๐
sendemail.outlookidfix
If true, makes git-send-email(1) assume --outlook-id-fix, and if false assume --no-outlook-id-fix. If not specified, it will behave the same way as if --outlook-id-fix is not specified. ๐ฆ
sendemail.signedOffCc (deprecated)
Deprecated alias for sendemail.signedOffByCc. Bestie it's deprecated, use the other one, I'm begging ๐ญ
sendemail.smtpBatchSize
Number of messages to be sent per connection, after that a relogin will happen. If the value is 0 or undefined, send all messages in one connection. See also the --batch-size option of git-send-email(1). ๐ฅ
sendemail.smtpReloginDelay
Seconds to wait before reconnecting to the smtp server. See also the --relogin-delay option of git-send-email(1).
sendemail.forbidSendmailVariables
To avoid common misconfiguration mistakes, git-send-email(1) will abort with a warning if any configuration options for sendmail exist. Set this variable to bypass the check. ๐
sequence.editor
Text editor used by git rebase -i for editing the rebase instruction file. The value is meant to be interpreted by the shell when it is used. It can be overridden by the GIT_SEQUENCE_EDITOR environment variable. When not configured, the default commit message editor is used instead. ๐
showBranch.default
The default set of branches for git-show-branch(1). See git-show-branch(1). (yes, that's the whole thing, short and slay)
sideband.allowControlCharacters
By default, control characters that are delivered via the sideband are masked, except ANSI color sequences. This prevents potentially unwanted ANSI escape sequences from being sent to the terminal. Use this config setting to override this behavior (the value can be a comma-separated list of the following keywords):
colorโ Allow ANSI color sequences, line feeds and horizontal tabs, but mask all other control characters. This is the default. โจcursorโ Allow control sequences that move the cursor. This is disabled by default.eraseโ Allow control sequences that erase characters. This is disabled by default.falseโ Mask all control characters other than line feeds and horizontal tabs.trueโ Allow all control characters to be sent to the terminal. โ ๏ธ (yes all of them, be so serious)
sideband.<url>.*
Apply the sideband.* option selectively to specific URLs. The same URL matching logic applies as for http.<url>.* settings. ๐
sparse.expectFilesOutsideOfPatterns
Typically with sparse checkouts, files not matching any sparsity patterns are marked with a SKIP_WORKTREE bit in the index and are missing from the working tree. Accordingly, Git will ordinarily check whether files with the SKIP_WORKTREE bit are in fact present in the working tree contrary to expectations. If Git finds any, it marks those paths as present by clearing the relevant SKIP_WORKTREE bits. This option can be used to tell Git that such present-despite-skipped files are expected and to stop checking for them.
The default is false, which allows Git to automatically recover from the list of files in the index and working tree falling out of sync.
Set this to true if you are in a setup where some external factor relieves Git of the responsibility for maintaining the consistency between the presence of working tree files and sparsity patterns. For example, if you have a Git-aware virtual file system that has a robust mechanism for keeping the working tree and the sparsity patterns up to date based on access patterns. ๐ฆ
Regardless of this setting, Git does not check for present-despite-skipped files unless sparse checkout is enabled, so this config option has no effect unless core.sparseCheckout is true. (read that twice, bestie ๐ซถ)
splitIndex.maxPercentChange
When the split index feature is used, this specifies the percent of entries the split index can contain compared to the total number of entries in both the split index and the shared index before a new shared index is written. The value should be between 0 and 100. If the value is 0, then a new shared index is always written; if it is 100, a new shared index is never written. By default, the value is 20, so a new shared index is written if the number of entries in the split index would be greater than 20 percent of the total number of entries. See git-update-index(1). ๐
๐ธ splitIndex.sharedIndexExpire
ok so when you're using the split index feature, shared index files that haven't been touched since the time this variable says will get yeeted ๐๏ธ the moment a new shared index file is created. Set it to "now" and literally everything expires immediately (chaotic, love that for you), and "never" means expiration just never happens at all. Default is "2.weeks.ago". Heads up tho โ a shared index file counts as modified (for expiration purposes) every single time a new split-index file is created based on it or read from it. See git-update-index(1) ๐
๐ ssh.variant
By default, Git figures out which command line arguments to use based on the basename of the SSH command you configured (that's via the GIT_SSH or GIT_SSH_COMMAND environment variable, or the core.sshCommand config setting). If that basename is unrecognized, Git goes detective mode ๐ โ it first invokes your configured SSH command with the -G (print configuration) option to try to detect OpenSSH option support, and then uses OpenSSH options if that worked, or no options besides the host and remote command if it failed.
You can override all that detection with ssh.variant. The valid values are ssh (use OpenSSH options), plink, putty, tortoiseplink, and simple (no options except the host and remote command). You can explicitly ask for the default auto-detection with the value auto. Any other value gets treated as ssh. This setting can also be overridden via the environment variable GIT_SSH_VARIANT.
The current command-line parameters used for each variant are:
sshโ[-p port] [-4] [-6] [-o option] [username@]host commandsimpleโ[username@]host commandplinkorputtyโ[-P port] [-4] [-6] [username@]host commandtortoiseplinkโ[-P port] [-4] [-6] -batch [username@]host command
ngl bestie, except for the simple variant, those command-line parameters are likely to change as git gains new features. lowkey a moving target ๐ฏ
๐ stash.index
If this is true, then git stash apply and git stash pop act like you passed --index. Defaults to false. See the descriptions in git-stash(1).
This also affects invocations of git-stash(1) via --autostash from commands like git-merge(1), git-rebase(1), and git-pull(1). slay, autostash stays winning โจ
๐ฆ stash.showIncludeUntracked
Set this to true and git stash show will show the untracked files of a stash entry. Defaults to false. See the description of the 'show' command in git-stash(1).
๐ง stash.showPatch
Set this to true and git stash show without any option will show the stash entry in patch form. Defaults to false. See the description of the 'show' command in git-stash(1).
๐ stash.showStat
Set this to true and git stash show without any option will show a diffstat of the stash entry. Defaults to true. See the description of the 'show' command in git-stash(1).
๐
status.relativePaths
By default, git-status(1) shows paths relative to the current directory. Set this variable to false and it shows paths relative to the repository root instead (fun fact: that was the default for Git prior to v1.5.4, vintage ๐).
โญ status.short
Set to true to enable --short by default in git-status(1). The option --no-short takes precedence over this variable.
๐ status.branch
Set to true to enable --branch by default in git-status(1). The option --no-branch takes precedence over this variable.
๐ status.aheadBehind
Set to true to enable --ahead-behind and false to enable --no-ahead-behind by default in git-status(1) for non-porcelain status formats. Defaults to true.
๐ฅ status.compareBranches
A space-separated list of branch comparison specifiers to use in git-status(1). Currently only @{upstream} and @{push} are supported. They're interpreted as branch@{upstream} and branch@{push} for the current branch.
If you don't set it, the default behavior is equivalent to @{upstream}, which compares against the configured upstream tracking branch.
The entries show up in the order they appear in the configuration. Duplicate entries that resolve to the same ref get suppressed after their first occurrence, so @{push} @{upstream} @{push} shows at most two comparisons. When @{upstream} and @{push} resolve to the same remote-tracking branch, only one comparison is shown. no dupes, no drama ๐
Example:
[status]
compareBranches = @{upstream} @{push}
This would show comparisons against both the configured upstream and push tracking branches for the current branch. iconic.
๐ status.displayCommentPrefix
If set to true, git-status(1) will insert a comment prefix before each output line (starting with core.commentChar, i.e. # by default). This was the behavior of git-status(1) in Git 1.8.4 and previous. Defaults to false.
๐ธ status.renameLimit
The number of files to consider when performing rename detection in git-status(1) and git-commit(1). Defaults to the value of diff.renameLimit.
โจ status.renames
Whether and how Git detects renames in git-status(1) and git-commit(1). If set to "false", rename detection is disabled. If set to "true", basic rename detection is enabled. If set to "copies" or "copy", Git will detect copies as well. Defaults to the value of diff.renames.
๐ status.showStash
If set to true, git-status(1) will display the number of entries currently stashed away. Defaults to false.
๐ซถ status.showUntrackedFiles
By default, git-status(1) and git-commit(1) show files that aren't currently tracked by Git. Directories that contain only untracked files are shown with the directory name only. And showing untracked files means Git has to lstat() all the files in the whole repository, which can be slow on some systems ๐ญ. So this variable controls how the commands display the untracked files. Possible values are:
noโ show no untracked files.normalโ show untracked files and directories.allโ also show individual files in untracked directories.
If this variable isn't specified, it defaults to normal. All the usual spellings for Boolean true are taken as normal and false as no. This variable can be overridden with the -u|--untracked-files option of git-status(1) and git-commit(1).
๐ status.submoduleSummary
Defaults to false. If you set this to a non-zero number or true (identical to -1 or an unlimited number), the submodule summary gets enabled and a summary of commits for modified submodules will be shown (see the --summary-limit option of git-submodule(1)). Please note that the summary output command will be suppressed for all submodules when diff.ignoreSubmodules is set to all, or only for those submodules where submodule.<name>.ignore=all. The one and only exception to that rule is that status and commit will show staged submodule changes. If you also wanna view the summary for ignored submodules, you can either use the --ignore-submodules=dirty command-line option or the git submodule summary command, which shows similar output but does not honor these settings. iykyk ๐
๐ง submodule.<name>.url
The URL for a submodule. This variable gets copied from the .gitmodules file to the git config via git submodule init. You can change the configured URL before obtaining the submodule via git submodule update. If neither submodule.<name>.active nor submodule.active are set, the presence of this variable is used as a fallback to indicate whether the submodule is of interest to git commands. See git-submodule(1) and gitmodules(5) for details.
๐ฟ submodule.<name>.update
The method by which a submodule is updated by git submodule update โ which is the only affected command, others such as git checkout --recurse-submodules are unaffected. It exists for historical reasons, back when git submodule was the only command to interact with submodules; settings like submodule.active and pull.rebase are more specific. It's populated by git submodule init from the gitmodules(5) file. See description of update command in git-submodule(1).
๐ submodule.<name>.branch
The remote branch name for a submodule, used by git submodule update --remote. Set this option to override the value found in the .gitmodules file. See git-submodule(1) and gitmodules(5) for details.
๐ฆ submodule.<name>.fetchRecurseSubmodules
This option controls recursive fetching of this particular submodule. It can be overridden by using the --[no-]recurse-submodules command-line option to "git fetch" and "git pull". This setting will override the one from the gitmodules(5) file.
๐ submodule.<name>.ignore
Defines under what circumstances "git status" and the diff family show a submodule as modified:
- Set it to
"all"and it will never consider the submodule modified. It can nevertheless be staged using the option--force, and it will then show up in the output of status. - Set it to
"dirty"and it ignores all changes to the submodule's work tree, taking only differences between the HEAD of the submodule and the commit recorded in the superproject into account. "untracked"will additionally let submodules with modified tracked files in their work tree show up.- Set it to
"none"(the default) and it also shows submodules as changed if they have untracked files in their work tree.
This setting overrides any setting made in .gitmodules for this submodule, and both settings can be overridden on the command line by using the "--ignore-submodules" option. The git submodule commands are not affected by this setting, jsyk.
๐ submodule.<name>.active
Boolean value indicating if the submodule is of interest to git commands. This config option takes precedence over the submodule.active config option. See gitsubmodules(7) for details.
๐ submodule.<name>.gitdir
This sets the gitdir path for submodule <name>. This configuration is respected when extensions.submodulePathConfig is enabled โ otherwise it has no effect at all. When enabled, this config becomes the single source of truth for submodule gitdir paths and Git will error if it's missing. See git-config(1) for details.
๐ธ submodule.active
A repeated field containing a pathspec used to match against a submodule's path to determine if the submodule is of interest to git commands. See gitsubmodules(7) for details ๐ซถ
submodule.recurse
A boolean that says "hey, should commands turn on --recurse-submodules by default?" Defaults to false โ so no, unless you say so.
When you set it to true, you can still turn it off with --no-recurse-submodules. But here's the messy part, bestie: some Git commands don't even have that option, yet they call the commands above that are affected by submodule.recurse. Example: git remote update will call git fetch but has no --no-recurse-submodules option of its own. For those, the workaround is to temporarily change the config value with git -c submodule.recurse=0.
Here's the rundown on which commands take --recurse-submodules and whether this setting plays nice with them:
checkout,fetch,grep,pull,push,read-tree,reset,restoreandswitchare always supported.cloneandls-filesare not supported.branchis supported only ifsubmodule.propagateBranchesis enabled.
submodule.propagateBranches
[EXPERIMENTAL] A boolean that enables branching support when you're using --recurse-submodules or submodule.recurse=true. Turn this on and certain commands will accept --recurse-submodules, and certain commands that already accept --recurse-submodules will now actually consider branches. Defaults to false.
submodule.fetchJobs
Tells Git how many submodules get fetched/cloned at the same time. A positive integer allows up to that many submodules fetched in parallel. A value of 0 gives you some reasonable default. If it's unset, it defaults to 1.
submodule.alternateLocation
Specifies how submodules obtain alternates when they're cloned. Possible values are no and superproject. By default no is assumed, which doesn't add references. When the value is set to superproject, the submodule being cloned computes its alternates location relative to the superproject's alternate.
submodule.alternateErrorStrategy
Specifies how to treat errors with the alternates for a submodule as computed via submodule.alternateLocation. Possible values are ignore, info, die. Default is die. Heads up: if it's set to ignore or info, and there's an error with the computed alternate, the clone proceeds as if no alternate was specified at all.
tag.forceSignAnnotated
A boolean specifying whether annotated tags created should be GPG signed. If --annotate is specified on the command line, it takes precedence over this option. Command line stays the main character ๐
tag.sort
This variable controls the sort ordering of tags when git-tag(1) displays them. Without the --sort=<value> option provided, the value of this variable is used as the default.
tag.gpgSign
A boolean specifying whether all tags should be GPG signed. Careful though: using this in an automated script can result in a large number of tags being signed. So it's convenient to use an agent to avoid typing your GPG passphrase over and over again. Note that this option doesn't affect tag signing behavior enabled by -u <keyid> or --local-user=<keyid> options.
tar.umask
This variable can be used to restrict the permission bits of tar archive entries. The default is 0002, which turns off the world write bit. The special value "user" indicates the archiving user's umask will be used instead. See umask(2) and git-archive(1).
โ ๏ธ Trace2 config settings are only read from the system and global config files; repository local and worktree config files and -c command line arguments are not respected. No cap, that's just how it is.
trace2.normalTarget
This variable controls the normal target destination. It may be overridden by the GIT_TRACE2 environment variable. The following table shows possible values โ but tables are so not happening here, so here's the same list, cute edition:
trace2.perfTarget
This variable controls the performance target destination. It may be overridden by the GIT_TRACE2_PERF environment variable. Following the same possible values.
trace2.eventTarget
This variable controls the event target destination. It may be overridden by the GIT_TRACE2_EVENT environment variable. Following the same possible values.
And those possible values for all three of the above are:
0orfalseโ Disables the target. nothing to see here ๐ฆ1ortrueโ Writes to STDERR.[2-9]โ Writes to the already opened file descriptor.<absolute-pathname>โ Writes to the file in append mode. If the target already exists and is a directory, the traces will be written to files (one per process) underneath the given directory.af_unix:[<socket-type>:]<absolute-pathname>โ Write to a Unix DomainSocket (on platforms that support them). Socket type can be eitherstreamordgram; if omitted Git will try both.
trace2.normalBrief
Boolean. When true, time, filename, and line fields are omitted from normal output. May be overridden by the GIT_TRACE2_BRIEF environment variable. Defaults to false.
trace2.perfBrief
Boolean. When true, time, filename, and line fields are omitted from PERF output. May be overridden by the GIT_TRACE2_PERF_BRIEF environment variable. Defaults to false.
trace2.eventBrief
Boolean. When true, time, filename, and line fields are omitted from event output. May be overridden by the GIT_TRACE2_EVENT_BRIEF environment variable. Defaults to false.
trace2.eventNesting
Integer. Specifies desired depth of nested regions in the event output. Regions deeper than this value will be omitted. May be overridden by the GIT_TRACE2_EVENT_NESTING environment variable. Defaults to 2.
trace2.configParams
A comma-separated list of patterns of "important" config settings that should be recorded in the trace2 output. For example, core.*,remote.*.url would cause the trace2 output to contain events listing each configured remote. May be overridden by the GIT_TRACE2_CONFIG_PARAMS environment variable. Unset by default.
trace2.envVars
A comma-separated list of "important" environment variables that should be recorded in the trace2 output. For example, GIT_HTTP_USER_AGENT,GIT_CONFIG would cause the trace2 output to contain events listing the overrides for HTTP user agent and the location of the Git configuration file (assuming any are set). May be overridden by the GIT_TRACE2_ENV_VARS environment variable. Unset by default.
trace2.destinationDebug
Boolean. When true, Git will print error messages when a trace target destination cannot be opened for writing. By default, these errors are suppressed and tracing is silently disabled. sneaky, honestly. May be overridden by the GIT_TRACE2_DST_DEBUG environment variable.
trace2.maxFiles
Integer. When writing trace files to a target directory, don't write additional traces if doing so would exceed this many files. Instead, write a sentinel file that will block further tracing to this directory. Defaults to 0, which disables this check. sentinel file my beloved ๐ง
trailer.separators
This option tells which characters are recognized as trailer separators. By default only : is recognized as a trailer separator, except that = is always accepted on the command line for compatibility with other git commands.
The first character given by this option will be the default character used when another separator isn't specified in the config for this trailer.
For example, if the value for this option is %=$, โ wait, no, if the value is %=$ โ then only lines using the format <key><sep><value> with <sep> containing %, = or $ and then spaces will be considered trailers. And % will be the default separator used, so by default trailers will appear like: <key>% <value> (one percent sign and one space will appear between the key and the value).
bestie that <sep> tip is lowkey the whole personality of the trailer config ๐ญ
trailer.where
This option tells where a new trailer will be added.
This can be end, which is the default, start, after or before.
If it's end, then each new trailer will appear at the end of the existing trailers.
If it's start, then each new trailer will appear at the start, instead of the end, of the existing trailers.
If it's after, then each new trailer will appear just after the last trailer with the same <key>.
If it's before, then each new trailer will appear just before the first trailer with the same <key>.
trailer.ifexists
This option makes it possible to choose what action will be performed when there's already at least one trailer with the same <key> in the input.
The valid values for this option are: addIfDifferentNeighbor (this is the default), addIfDifferent, add, replace or doNothing.
- With
addIfDifferentNeighbor, a new trailer will be added only if no trailer with the same (<key>,<value>) pair is above or below the line where the new trailer will be added. - With
addIfDifferent, a new trailer will be added only if no trailer with the same (<key>,<value>) pair is already in the input. - With
add, a new trailer will be added, even if some trailers with the same (<key>,<value>) pair are already in the input. chaos mode, love that for you ๐ - With
replace, an existing trailer with the same<key>will be deleted and the new trailer will be added. The deleted trailer will be the closest one (with the same<key>) to the place where the new one will be added. - With
doNothing, nothing will be done; that is, no new trailer will be added if there's already one with the same<key>in the input.
trailer.ifmissing
This option makes it possible to choose what action will be performed when there isn't yet any trailer with the same <key> in the input.
The valid values for this option are: add (this is the default) and doNothing.
With add, a new trailer will be added.
With doNothing, nothing will be done. the vibes of doing absolutely nothing โจ
trailer.<key-alias>.key
Defines a <key-alias> for the <key>. The <key-alias> must be a prefix (case does not matter) of the <key>. For example, in git config trailer.ack.key "Acked-by" the Acked-by is the <key> and the ack is the <key-alias>. This configuration allows the shorter --trailer "ack:..." invocation on the command line using the "ack" <key-alias> instead of the longer --trailer "Acked-by:...".
At the end of the <key>, a separator can appear and then some space characters. By default the only valid separator is :, but this can be changed using the trailer.separators config variable.
If there's a separator in the key, then it overrides the default separator when adding the trailer. glow up, honestly ๐ซถ
trailer.<key-alias>.whereโ this one takes the exact same values as thetrailer.whereconfiguration variable, and it overrides what that option says for trailers with the specified<key-alias>. Per-alias override era, no cap. โจtrailer.<key-alias>.ifexistsโ same deal: it takes the exact same values as thetrailer.ifexistsconfiguration variable, and it overrides what that option says for trailers with the specified<key-alias>. ๐trailer.<key-alias>.ifmissingโ and again, bestie: same values astrailer.ifmissing, overriding what that option says for trailers with the specified<key-alias>. ๐trailer.<key-alias>.commandโ deprecated in favor oftrailer.<key-alias>.cmd, okay? It behaves in the same way astrailer.<key-alias>.cmd, except that it doesnโt pass anything as argument to the specified command. Instead, the first occurrence of substring$ARGis replaced by the<value>that would be passed as argument.
Note that $ARG in the userโs command is only replaced once and that the original way of replacing $ARG is not safe. ๐ญ
When both trailer.<key-alias>.cmd and trailer.<key-alias>.command are given for the same <key-alias>, trailer.<key-alias>.cmd is used and trailer.<key-alias>.command is ignored.
trailer.<key-alias>.cmdโ this option can be used to specify a shell command that will be called once to automatically add a trailer with the specified<key-alias>, and then called each time a--trailer <key-alias>=<value>argument is specified to modify the<value>of the trailer that this option would produce. ๐
When the specified command is first called to add a trailer with the specified <key-alias>, the behavior is as if a special --trailer <key-alias>=<value> argument was added at the beginning of git-interpret-trailers(1), where <value> is taken to be the standard output of the command with any leading and trailing whitespace trimmed off.
If some --trailer <key-alias>=<value> arguments are also passed on the command line, the command is called again once for each of these arguments with the same <key-alias>. And the <value> part of these arguments, if any, will be passed to the command as its first argument. This way the command can produce a <value> computed from the <value> passed in the --trailer <key-alias>=<value> argument. Obsessed with the little pipeline. ๐ซถ
transfer.credentialsInUrlโ bestie, a configured URL can contain plaintext credentials in the form<protocol>://<user>:<password>@<domain>/<path>. You may want to warn or forbid the use of such configuration (in favor of usinggit-credential(1)). This will be used ongit-clone(1),git-fetch(1),git-push(1), and any other direct use of the configured URL. ๐
Note that this is currently limited to detecting credentials in remote.<name>.url configuration; it wonโt detect credentials in remote.<name>.pushurl configuration.
You might want to enable this to prevent inadvertent credentials exposure, e.g. because:
- The OS or system where youโre running git may not provide a way or otherwise allow you to configure the permissions of the configuration file where the username and/or password are stored.
- Even if it does, having such data stored "at rest" might expose you in other ways, e.g. a backup process might copy the data to another system.
- The git programs will pass the full URL to one another as arguments on the command-line, meaning the credentials will be exposed to other unprivileged users on systems that allow them to see the full process list of other users. On linux the "hidepid" setting documented in
procfs(5)allows for configuring this behavior.
If such concerns donโt apply to you then you probably donโt need to be concerned about credentials exposure due to storing sensitive data in gitโs configuration files. If you do want to use this, set transfer.credentialsInUrl to one of these values:
allow(default): Git will proceed with its activity without warning.warn: Git will write a warning message tostderrwhen parsing a URL with a plaintext credential.die: Git will write a failure message tostderrwhen parsing a URL with a plaintext credential.
transfer.fsckObjectsโ whenfetch.fsckObjectsorreceive.fsckObjectsare not set, the value of this variable is used instead. Defaults tofalse. ๐ฅ
When set, the fetch or receive will abort in the case of a malformed object or a link to a nonexistent object. In addition, various other issues are checked for, including legacy issues (see fsck.<msg-id>), and potential security issues like the existence of a .GIT directory or a malicious .gitmodules file (see the release notes for v2.2.1 and v2.17.1 for details). Other sanity and security checks may be added in future releases.
On the receiving side, failing fsckObjects will make those objects unreachable, see "QUARANTINE ENVIRONMENT" in git-receive-pack(1). On the fetch side, malformed objects will instead be left unreferenced in the repository.
Due to the non-quarantine nature of the fetch.fsckObjects implementation it cannot be relied upon to leave the object store clean like receive.fsckObjects can. ๐ญ
As objects are unpacked theyโre written to the object store, so there can be cases where malicious objects get introduced even though the "fetch" failed, only to have a subsequent "fetch" succeed because only new incoming objects are checked, not those that have already been written to the object store. That difference in behavior should not be relied upon. In the future, such objects may be quarantined for "fetch" as well.
For now, the paranoid need to find some way to emulate the quarantine environment if theyโd like the same protection as "push". E.g. in the case of an internal mirror do the mirroring in two steps, one to fetch the untrusted objects, and then do a second "push" (which will use the quarantine) to another internal repo, and have internal clients consume this pushed-to repository, or embargo internal fetches and only allow them once a full "fsck" has run (and no new fetches have happened in the meantime).
transfer.hideRefsโ string(s)receive-packandupload-packuse to decide which refs to omit from their initial advertisements. Use more than one definition to specify multiple prefix strings. A ref that is under the hierarchies listed in the value of this variable is excluded, and is hidden when responding togit pushorgit fetch. Seereceive.hideRefsanduploadpack.hideRefsfor program-specific versions of this config. ๐ฆ
You may also include a ! in front of the ref name to negate the entry, explicitly exposing it, even if an earlier entry marked it as hidden. If you have multiple hideRefs values, later entries override earlier ones (and entries in more-specific config files override less-specific ones).
If a namespace is in use, the namespace prefix is stripped from each reference before it is matched against transfer.hiderefs patterns. In order to match refs before stripping, add a ^ in front of the ref name. If you combine ! and ^, ! must be specified first.
For example, if refs/heads/master is specified in transfer.hideRefs and the current namespace is foo, then refs/namespaces/foo/refs/heads/master is omitted from the advertisements. If uploadpack.allowRefInWant is set, upload-pack will treat want-ref refs/heads/master in a protocol v2 fetch command as if refs/namespaces/foo/refs/heads/master did not exist. receive-pack, on the other hand, will still advertise the object id the ref is pointing to without mentioning its name (a so-called ".have" line).
Even if you hide refs, a client may still be able to steal the target objects via the techniques described in the "SECURITY" section of the gitnamespaces(7) man page; itโs best to keep private data in a separate repository. ๐
transfer.unpackLimitโ whenfetch.unpackLimitorreceive.unpackLimitare not set, the value of this variable is used instead. The default value is100. ๐transfer.advertiseSIDโ Boolean. When true, client and server processes will advertise their unique session IDs to their remote counterpart. Defaults tofalse. โจtransfer.bundleURIโ when true, localgit clonecommands will request bundle information from the remote server (if advertised) and download bundles before continuing the clone through the Git protocol. Defaults tofalse. ๐transfer.advertiseObjectInfoโ when true, the object-info capability is advertised by servers. Defaults tofalse. ๐uploadarchive.allowUnreachableโ if true, allow clients to usegit archive --remoteto request any tree, whether reachable from the ref tips or not. See the discussion in the "SECURITY" section ofgit-upload-archive(1)for more details. Defaults tofalse. ๐ธuploadpack.hideRefsโ this variable is the same astransfer.hideRefs, but applies only toupload-pack(and so affects only fetches, not pushes). An attempt to fetch a hidden ref bygit fetchwill fail. See alsouploadpack.allowTipSHA1InWant. ๐ซถuploadpack.allowTipSHA1InWantโ whenuploadpack.hideRefsis in effect, allowupload-packto accept a fetch request that asks for an object at the tip of a hidden ref (by default, such a request is rejected). See alsouploadpack.hideRefs. Even if this isfalse, a client may be able to steal objects via the techniques described in the "SECURITY" section of thegitnamespaces(7)man page; itโs best to keep private data in a separate repository. ๐ญuploadpack.allowReachableSHA1InWantโ allowupload-packto accept a fetch request that asks for an object that is reachable from any ref tip. However, note that calculating object reachability is computationally expensive. Defaults tofalse. Even if this isfalse, a client may be able to steal objects via the techniques described in the "SECURITY" section of thegitnamespaces(7)man page; itโs best to keep private data in a separate repository. ๐uploadpack.allowAnySHA1InWantโ okay so this one letsupload-packstraight up accept a fetch request that asks for any object at all. It impliesuploadpack.allowTipSHA1InWantanduploadpack.allowReachableSHA1InWantโ like, set it totrueand both of those get turned on, set it tofalseand both get turned off, no in-between bestie. By default it's not set. ๐uploadpack.keepAliveโ so whenupload-packhas startedpack-objects, there can be a quiet period whilepack-objectsgets the pack ready. Normally it'd output progress info, but if--quietwas used for the fetch,pack-objectswill output nothing at all until the pack data begins ๐ญ and some clients and networks may think the server is hung and just give up. Setting this option tellsupload-packto send an empty keepalive packet everyuploadpack.keepAliveseconds. Setting it to0disables keepalive packets entirely. Default is5seconds. ๐ซถuploadpack.packObjectsHookโ if this is set, whenupload-packwould rungit pack-objectsto create a packfile for a client, it runs this shell command instead. Thepack-objectscommand and arguments it would have run (including thegit pack-objectsat the beginning) get appended to the shell command. The stdin and stdout of the hook are treated as ifpack-objectsitself was run โ i.e.,upload-packwill feed input intended forpack-objectsto the hook, and expects a completed packfile on stdout. ๐
ngl this one is only respected when it's specified in protected configuration (see the section called "SCOPES"). That's a safety measure against fetching from untrusted repositories. Do not skip this. ๐ฅ
uploadpack.allowFilterโ if set,upload-packwill support partial clone and partial fetch object filtering. Obsessed. โจuploadpackfilter.allowโ gives a default value for unspecified object filters (see the config variable right below, iykyk). If set totrue, this also enables all filters which get added in the future โ main character energy, it's thinking ahead ๐. Defaults totrue.uploadpackfilter.<filter>.allowโ explicitly allow or ban the object filter corresponding to<filter>, where<filter>may be one of:blob:none,blob:limit,object:type,tree,sparse:oid, orcombine. If you're using combined filters, bothcombineand all of the nested filter kinds must be allowed. Defaults touploadpackfilter.allow.uploadpackfilter.tree.maxDepthโ only allows--filter=tree:<n>when<n>is no more than the value ofuploadpackfilter.tree.maxDepth. If set, this also impliesuploadpackfilter.tree.allow=true, unless this configuration variable had already been set. Has no effect if unset. ๐ฆuploadpack.allowRefInWantโ if set,upload-packwill support the ref-in-want feature of the protocol version 2 fetch command. This feature is intended for the benefit of load-balanced servers which may not have the same view of what OIDs their refs point to due to replication delay. literally made for the messy server girlies ๐url.<base>.insteadOfโ any URL that starts with this value will be rewritten to start, instead, with<base>. In cases where some site serves a large number of repositories and serves them with multiple access methods, and some users need to use different access methods, this feature lets people specify any of the equivalent URLs and have Git automatically rewrite the URL to the best alternative for that particular user โ even for a never-before-seen repository on the site. When more than oneinsteadOfstring matches a given URL, the longest match is used. ๐
heads up: any protocol restrictions will be applied to the rewritten URL. If the rewrite changes the URL to use a custom protocol or remote helper, you may need to adjust theprotocol.*.allowconfig to permit the request. In particular, protocols you expect to use for submodules must be set toalwaysrather than the default ofuser. See the description ofprotocol.allowabove. ๐ซก
url.<base>.pushInsteadOfโ any URL that starts with this value will not be pushed to; instead, it will be rewritten to start with<base>, and the resulting URL will be pushed to. In cases where some site serves a large number of repositories with multiple access methods, some of which don't allow push, this feature lets people specify a pull-only URL and have Git automatically use an appropriate URL to push โ even for a never-before-seen repository on the site. When more than onepushInsteadOfstring matches a given URL, the longest match is used. If a remote has an explicitpushurl, Git will ignore this setting for that remote. ๐user.name,user.email,author.name,author.email,committer.name,committer.emailโ theuser.nameanduser.emailvariables determine what ends up in the author and committer fields of commit objects. If you need the author or committer to be different, you can setauthor.name,author.email,committer.name, orcommitter.email. All of these can be overridden by theGIT_AUTHOR_NAME,GIT_AUTHOR_EMAIL,GIT_COMMITTER_NAME,GIT_COMMITTER_EMAIL, andEMAILenvironment variables. ๐ธ
note that the name forms of these variables conventionally refer to some form of a personal name. Seegit-commit(1)and the environment variables section ofgit(1)for more info on these settings โ and check thecredential.usernameoption if you're actually looking for authentication credentials instead. Different thing, bestie, don't mix them up ๐
user.useConfigOnlyโ tells Git to avoid trying to guess defaults foruser.emailanduser.name, and instead retrieve the values only from the configuration. For example: if you have multiple email addresses and would like to use a different one for each repository, then with this config option set totruein the global config along with a name, Git will prompt you to set up an email before making new commits in a newly cloned repository. Defaults tofalse. ๐user.signingKeyโ ifgit-tag(1)orgit-commit(1)isn't selecting the key you want it to automatically when creating a signed tag or commit, you can override the default selection with this variable. This option is passed unchanged to gpg's--local-userparameter, so you may specify a key using any method that gpg supports. Ifgpg.formatis set tosshthis can contain the path to either your private ssh key or the public key whenssh-agentis used. Alternatively it can contain a public key prefixed withkey::directly (e.g.:"key::ssh-rsa XXXXXX identifier"). The private key needs to be available viassh-agent. If not set Git will callgpg.ssh.defaultKeyCommand(e.g.:"ssh-add -L") and try to use the first key available. For backward compatibility, a raw key which begins with"ssh-", such as"ssh-rsa XXXXXX identifier", is treated as"key::ssh-rsa XXXXXX identifier", but this form is deprecated โ use thekey::form instead. โญversionsort.prereleaseSuffix(deprecated) โ deprecated alias forversionsort.suffix. Ignored ifversionsort.suffixis set. it's giving legacy, we don't use her anymore ๐versionsort.suffixโ even when version sort is used ingit-tag(1), tagnames with the same base version but different suffixes are still sorted lexicographically, which results in e.g. prerelease tags appearing after the main release (e.g."1.0-rc1"after"1.0"). This variable can be specified to determine the sorting order of tags with different suffixes. ๐ฆ By specifying a single suffix in this variable, any tagname containing that suffix will appear before the corresponding main release. E.g. if the variable is set to"-rc", then all"1.0-rcX"tags will appear before"1.0". If specified multiple times, once per suffix, then the order of suffixes in the configuration will determine the sorting order of tagnames with those suffixes. E.g. if"-pre"appears before"-rc"in the configuration, then all"1.0-preX"tags will be listed before any"1.0-rcX"tags. The placement of the main release tag relative to tags with various suffixes can be determined by specifying the empty suffix among those other suffixes. E.g. if the suffixes"-rc","","-ck", and"-bfs"appear in the configuration in this order, then all"v4.8-rcX"tags are listed first, followed by"v4.8", then"v4.8-ckX"and finally"v4.8-bfsX". ๐ญ this is so much ordering but slay If more than one suffix matches the same tagname, then that tagname will be sorted according to the suffix which starts at the earliest position in the tagname. If more than one different matching suffix starts at that earliest position, then that tagname will be sorted according to the longest of those suffixes. The sorting order between different suffixes is undefined if they are in multiple config files. ๐web.browserโ specifies a web browser that may be used by some commands. Currently onlygit-instaweb(1)andgit-help(1)may use it.worktree.guessRemoteโ if no branch is specified and neither-bnor-Bnor--detachis used, thengit worktree adddefaults to creating a new branch fromHEAD. Ifworktree.guessRemoteis set totrue,worktree addtries to find a remote-tracking branch whose name uniquely matches the new branch name. If such a branch exists, it is checked out and set as"upstream"for the new branch. If multiple matches are found, the command fails. If no such match can be found, it falls back to creating a new branch from the currentHEAD. ๐worktree.useRelativePathsโ link worktrees using relative paths (when"true") or absolute paths (when"false"). This is particularly useful for setups where the repository and worktrees may be moved between different locations or environments. Defaults to"false". ๐
note that settingworktree.useRelativePathsto"true"implies enabling theextensions.relativeWorktreesconfig (seegit-config(1)), which makes it incompatible with older versions of Git. so cute but do read that twice ๐ซถ
๐ BUGS ๐
okay so there's this one cursed thing ๐ป When using the deprecated [section.subsection] syntax, changing a value will result in adding a multi-line key instead of a change, if the subsection is given with at least one uppercase character. Like, for example, when the config looks like
[section.subsection]
key = value1
and you run git config section.Subsection.key value2 the result will be
[section.subsection]
key = value1
key = value2
not me getting two keys ๐ that's the bug, that's the whole bug, periodt.
๐ง GIT ๐ง
Part of the git(1) suite. obviously ๐
family.
๐ NOTES ๐
- the bundle URI design document
file:///usr/share/doc/git-doc/technical/bundle-uri.html
and that's the whole page bestie, we ate and left zero crumbs ๐โจ this gem is Git 2.56.0, dated 2026-09-27 โ go be iconic with your configs, mwah ๐๐ซถ๐
๐ฆ where this page comes from
- arch rolling: git 2.56.0-1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms