blob: 13c959a63396c66b792c47588541960deb27c76f [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.10" />
<title>git-config(1)</title>
<style type="text/css">
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
/* Default font. */
body {
font-family: Georgia,serif;
}
/* Title font. */
h1, h2, h3, h4, h5, h6,
div.title, caption.title,
thead, p.table.header,
#toctitle,
#author, #revnumber, #revdate, #revremark,
#footer {
font-family: Arial,Helvetica,sans-serif;
}
body {
margin: 1em 5% 1em 5%;
}
a {
color: blue;
text-decoration: underline;
}
a:visited {
color: fuchsia;
}
em {
font-style: italic;
color: navy;
}
strong {
font-weight: bold;
color: #083194;
}
h1, h2, h3, h4, h5, h6 {
color: #527bbd;
margin-top: 1.2em;
margin-bottom: 0.5em;
line-height: 1.3;
}
h1, h2, h3 {
border-bottom: 2px solid silver;
}
h2 {
padding-top: 0.5em;
}
h3 {
float: left;
}
h3 + * {
clear: left;
}
h5 {
font-size: 1.0em;
}
div.sectionbody {
margin-left: 0;
}
hr {
border: 1px solid silver;
}
p {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
ul, ol, li > p {
margin-top: 0;
}
ul > li { color: #aaa; }
ul > li > * { color: black; }
.monospaced, code, pre {
font-family: "Courier New", Courier, monospace;
font-size: inherit;
color: navy;
padding: 0;
margin: 0;
}
pre {
white-space: pre-wrap;
}
#author {
color: #527bbd;
font-weight: bold;
font-size: 1.1em;
}
#email {
}
#revnumber, #revdate, #revremark {
}
#footer {
font-size: small;
border-top: 2px solid silver;
padding-top: 0.5em;
margin-top: 4.0em;
}
#footer-text {
float: left;
padding-bottom: 0.5em;
}
#footer-badges {
float: right;
padding-bottom: 0.5em;
}
#preamble {
margin-top: 1.5em;
margin-bottom: 1.5em;
}
div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
}
div.admonitionblock {
margin-top: 2.0em;
margin-bottom: 2.0em;
margin-right: 10%;
color: #606060;
}
div.content { /* Block element content. */
padding: 0;
}
/* Block element titles. */
div.title, caption.title {
color: #527bbd;
font-weight: bold;
text-align: left;
margin-top: 1.0em;
margin-bottom: 0.5em;
}
div.title + * {
margin-top: 0;
}
td div.title:first-child {
margin-top: 0.0em;
}
div.content div.title:first-child {
margin-top: 0.0em;
}
div.content + div.title {
margin-top: 0.0em;
}
div.sidebarblock > div.content {
background: #ffffee;
border: 1px solid #dddddd;
border-left: 4px solid #f0f0f0;
padding: 0.5em;
}
div.listingblock > div.content {
border: 1px solid #dddddd;
border-left: 5px solid #f0f0f0;
background: #f8f8f8;
padding: 0.5em;
}
div.quoteblock, div.verseblock {
padding-left: 1.0em;
margin-left: 1.0em;
margin-right: 10%;
border-left: 5px solid #f0f0f0;
color: #888;
}
div.quoteblock > div.attribution {
padding-top: 0.5em;
text-align: right;
}
div.verseblock > pre.content {
font-family: inherit;
font-size: inherit;
}
div.verseblock > div.attribution {
padding-top: 0.75em;
text-align: left;
}
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
div.verseblock + div.attribution {
text-align: left;
}
div.admonitionblock .icon {
vertical-align: top;
font-size: 1.1em;
font-weight: bold;
text-decoration: underline;
color: #527bbd;
padding-right: 0.5em;
}
div.admonitionblock td.content {
padding-left: 0.5em;
border-left: 3px solid #dddddd;
}
div.exampleblock > div.content {
border-left: 3px solid #dddddd;
padding-left: 0.5em;
}
div.imageblock div.content { padding-left: 0; }
span.image img { border-style: none; vertical-align: text-bottom; }
a.image:visited { color: white; }
dl {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
dt {
margin-top: 0.5em;
margin-bottom: 0;
font-style: normal;
color: navy;
}
dd > *:first-child {
margin-top: 0.1em;
}
ul, ol {
list-style-position: outside;
}
ol.arabic {
list-style-type: decimal;
}
ol.loweralpha {
list-style-type: lower-alpha;
}
ol.upperalpha {
list-style-type: upper-alpha;
}
ol.lowerroman {
list-style-type: lower-roman;
}
ol.upperroman {
list-style-type: upper-roman;
}
div.compact ul, div.compact ol,
div.compact p, div.compact p,
div.compact div, div.compact div {
margin-top: 0.1em;
margin-bottom: 0.1em;
}
tfoot {
font-weight: bold;
}
td > div.verse {
white-space: pre;
}
div.hdlist {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
div.hdlist tr {
padding-bottom: 15px;
}
dt.hdlist1.strong, td.hdlist1.strong {
font-weight: bold;
}
td.hdlist1 {
vertical-align: top;
font-style: normal;
padding-right: 0.8em;
color: navy;
}
td.hdlist2 {
vertical-align: top;
}
div.hdlist.compact tr {
margin: 0;
padding-bottom: 0;
}
.comment {
background: yellow;
}
.footnote, .footnoteref {
font-size: 0.8em;
}
span.footnote, span.footnoteref {
vertical-align: super;
}
#footnotes {
margin: 20px 0 20px 0;
padding: 7px 0 0 0;
}
#footnotes div.footnote {
margin: 0 0 5px 0;
}
#footnotes hr {
border: none;
border-top: 1px solid silver;
height: 1px;
text-align: left;
margin-left: 0;
width: 20%;
min-width: 100px;
}
div.colist td {
padding-right: 0.5em;
padding-bottom: 0.3em;
vertical-align: top;
}
div.colist td img {
margin-top: 0.3em;
}
@media print {
#footer-badges { display: none; }
}
#toc {
margin-bottom: 2.5em;
}
#toctitle {
color: #527bbd;
font-size: 1.1em;
font-weight: bold;
margin-top: 1.0em;
margin-bottom: 0.1em;
}
div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
margin-top: 0;
margin-bottom: 0;
}
div.toclevel2 {
margin-left: 2em;
font-size: 0.9em;
}
div.toclevel3 {
margin-left: 4em;
font-size: 0.9em;
}
div.toclevel4 {
margin-left: 6em;
font-size: 0.9em;
}
span.aqua { color: aqua; }
span.black { color: black; }
span.blue { color: blue; }
span.fuchsia { color: fuchsia; }
span.gray { color: gray; }
span.green { color: green; }
span.lime { color: lime; }
span.maroon { color: maroon; }
span.navy { color: navy; }
span.olive { color: olive; }
span.purple { color: purple; }
span.red { color: red; }
span.silver { color: silver; }
span.teal { color: teal; }
span.white { color: white; }
span.yellow { color: yellow; }
span.aqua-background { background: aqua; }
span.black-background { background: black; }
span.blue-background { background: blue; }
span.fuchsia-background { background: fuchsia; }
span.gray-background { background: gray; }
span.green-background { background: green; }
span.lime-background { background: lime; }
span.maroon-background { background: maroon; }
span.navy-background { background: navy; }
span.olive-background { background: olive; }
span.purple-background { background: purple; }
span.red-background { background: red; }
span.silver-background { background: silver; }
span.teal-background { background: teal; }
span.white-background { background: white; }
span.yellow-background { background: yellow; }
span.big { font-size: 2em; }
span.small { font-size: 0.6em; }
span.underline { text-decoration: underline; }
span.overline { text-decoration: overline; }
span.line-through { text-decoration: line-through; }
div.unbreakable { page-break-inside: avoid; }
/*
* xhtml11 specific
*
* */
div.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
}
div.tableblock > table {
border: 3px solid #527bbd;
}
thead, p.table.header {
font-weight: bold;
color: #527bbd;
}
p.table {
margin-top: 0;
}
/* Because the table frame attribute is overriden by CSS in most browsers. */
div.tableblock > table[frame="void"] {
border-style: none;
}
div.tableblock > table[frame="hsides"] {
border-left-style: none;
border-right-style: none;
}
div.tableblock > table[frame="vsides"] {
border-top-style: none;
border-bottom-style: none;
}
/*
* html5 specific
*
* */
table.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
}
thead, p.tableblock.header {
font-weight: bold;
color: #527bbd;
}
p.tableblock {
margin-top: 0;
}
table.tableblock {
border-width: 3px;
border-spacing: 0px;
border-style: solid;
border-color: #527bbd;
border-collapse: collapse;
}
th.tableblock, td.tableblock {
border-width: 1px;
padding: 4px;
border-style: solid;
border-color: #527bbd;
}
table.tableblock.frame-topbot {
border-left-style: hidden;
border-right-style: hidden;
}
table.tableblock.frame-sides {
border-top-style: hidden;
border-bottom-style: hidden;
}
table.tableblock.frame-none {
border-style: hidden;
}
th.tableblock.halign-left, td.tableblock.halign-left {
text-align: left;
}
th.tableblock.halign-center, td.tableblock.halign-center {
text-align: center;
}
th.tableblock.halign-right, td.tableblock.halign-right {
text-align: right;
}
th.tableblock.valign-top, td.tableblock.valign-top {
vertical-align: top;
}
th.tableblock.valign-middle, td.tableblock.valign-middle {
vertical-align: middle;
}
th.tableblock.valign-bottom, td.tableblock.valign-bottom {
vertical-align: bottom;
}
/*
* manpage specific
*
* */
body.manpage h1 {
padding-top: 0.5em;
padding-bottom: 0.5em;
border-top: 2px solid silver;
border-bottom: 2px solid silver;
}
body.manpage h2 {
border-style: none;
}
body.manpage div.sectionbody {
margin-left: 3em;
}
@media print {
body.manpage div#toc { display: none; }
}
</style>
<script type="text/javascript">
/*<![CDATA[*/
var asciidoc = { // Namespace.
/////////////////////////////////////////////////////////////////////
// Table Of Contents generator
/////////////////////////////////////////////////////////////////////
/* Author: Mihai Bazon, September 2002
* http://students.infoiasi.ro/~mishoo
*
* Table Of Content generator
* Version: 0.4
*
* Feel free to use this script under the terms of the GNU General Public
* License, as long as you do not remove or alter this notice.
*/
/* modified by Troy D. Hanson, September 2006. License: GPL */
/* modified by Stuart Rackham, 2006, 2009. License: GPL */
// toclevels = 1..4.
toc: function (toclevels) {
function getText(el) {
var text = "";
for (var i = el.firstChild; i != null; i = i.nextSibling) {
if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
text += i.data;
else if (i.firstChild != null)
text += getText(i);
}
return text;
}
function TocEntry(el, text, toclevel) {
this.element = el;
this.text = text;
this.toclevel = toclevel;
}
function tocEntries(el, toclevels) {
var result = new Array;
var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
// Function that scans the DOM tree for header elements (the DOM2
// nodeIterator API would be a better technique but not supported by all
// browsers).
var iterate = function (el) {
for (var i = el.firstChild; i != null; i = i.nextSibling) {
if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
var mo = re.exec(i.tagName);
if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
}
iterate(i);
}
}
}
iterate(el);
return result;
}
var toc = document.getElementById("toc");
if (!toc) {
return;
}
// Delete existing TOC entries in case we're reloading the TOC.
var tocEntriesToRemove = [];
var i;
for (i = 0; i < toc.childNodes.length; i++) {
var entry = toc.childNodes[i];
if (entry.nodeName.toLowerCase() == 'div'
&& entry.getAttribute("class")
&& entry.getAttribute("class").match(/^toclevel/))
tocEntriesToRemove.push(entry);
}
for (i = 0; i < tocEntriesToRemove.length; i++) {
toc.removeChild(tocEntriesToRemove[i]);
}
// Rebuild TOC entries.
var entries = tocEntries(document.getElementById("content"), toclevels);
for (var i = 0; i < entries.length; ++i) {
var entry = entries[i];
if (entry.element.id == "")
entry.element.id = "_toc_" + i;
var a = document.createElement("a");
a.href = "#" + entry.element.id;
a.appendChild(document.createTextNode(entry.text));
var div = document.createElement("div");
div.appendChild(a);
div.className = "toclevel" + entry.toclevel;
toc.appendChild(div);
}
if (entries.length == 0)
toc.parentNode.removeChild(toc);
},
/////////////////////////////////////////////////////////////////////
// Footnotes generator
/////////////////////////////////////////////////////////////////////
/* Based on footnote generation code from:
* http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
*/
footnotes: function () {
// Delete existing footnote entries in case we're reloading the footnodes.
var i;
var noteholder = document.getElementById("footnotes");
if (!noteholder) {
return;
}
var entriesToRemove = [];
for (i = 0; i < noteholder.childNodes.length; i++) {
var entry = noteholder.childNodes[i];
if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
entriesToRemove.push(entry);
}
for (i = 0; i < entriesToRemove.length; i++) {
noteholder.removeChild(entriesToRemove[i]);
}
// Rebuild footnote entries.
var cont = document.getElementById("content");
var spans = cont.getElementsByTagName("span");
var refs = {};
var n = 0;
for (i=0; i<spans.length; i++) {
if (spans[i].className == "footnote") {
n++;
var note = spans[i].getAttribute("data-note");
if (!note) {
// Use [\s\S] in place of . so multi-line matches work.
// Because JavaScript has no s (dotall) regex flag.
note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
spans[i].innerHTML =
"[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
"' title='View footnote' class='footnote'>" + n + "</a>]";
spans[i].setAttribute("data-note", note);
}
noteholder.innerHTML +=
"<div class='footnote' id='_footnote_" + n + "'>" +
"<a href='#_footnoteref_" + n + "' title='Return to text'>" +
n + "</a>. " + note + "</div>";
var id =spans[i].getAttribute("id");
if (id != null) refs["#"+id] = n;
}
}
if (n == 0)
noteholder.parentNode.removeChild(noteholder);
else {
// Process footnoterefs.
for (i=0; i<spans.length; i++) {
if (spans[i].className == "footnoteref") {
var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
href = href.match(/#.*/)[0]; // Because IE return full URL.
n = refs[href];
spans[i].innerHTML =
"[<a href='#_footnote_" + n +
"' title='View footnote' class='footnote'>" + n + "</a>]";
}
}
}
},
install: function(toclevels) {
var timerId;
function reinstall() {
asciidoc.footnotes();
if (toclevels) {
asciidoc.toc(toclevels);
}
}
function reinstallAndRemoveTimer() {
clearInterval(timerId);
reinstall();
}
timerId = setInterval(reinstall, 500);
if (document.addEventListener)
document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
else
window.onload = reinstallAndRemoveTimer;
}
}
asciidoc.install();
/*]]>*/
</script>
</head>
<body class="manpage">
<div id="header">
<h1>
git-config(1) Manual Page
</h1>
<h2>NAME</h2>
<div class="sectionbody">
<p>git-config -
Get and set repository or global options
</p>
</div>
</div>
<div id="content">
<div class="sect1">
<h2 id="_synopsis">SYNOPSIS</h2>
<div class="sectionbody">
<div class="verseblock">
<pre class="content"><em>git config</em> [&lt;file-option&gt;] [--type=&lt;type&gt;] [--show-origin] [-z|--null] name [value [value_regex]]
<em>git config</em> [&lt;file-option&gt;] [--type=&lt;type&gt;] --add name value
<em>git config</em> [&lt;file-option&gt;] [--type=&lt;type&gt;] --replace-all name value [value_regex]
<em>git config</em> [&lt;file-option&gt;] [--type=&lt;type&gt;] [--show-origin] [-z|--null] --get name [value_regex]
<em>git config</em> [&lt;file-option&gt;] [--type=&lt;type&gt;] [--show-origin] [-z|--null] --get-all name [value_regex]
<em>git config</em> [&lt;file-option&gt;] [--type=&lt;type&gt;] [--show-origin] [-z|--null] [--name-only] --get-regexp name_regex [value_regex]
<em>git config</em> [&lt;file-option&gt;] [--type=&lt;type&gt;] [-z|--null] --get-urlmatch name URL
<em>git config</em> [&lt;file-option&gt;] --unset name [value_regex]
<em>git config</em> [&lt;file-option&gt;] --unset-all name [value_regex]
<em>git config</em> [&lt;file-option&gt;] --rename-section old_name new_name
<em>git config</em> [&lt;file-option&gt;] --remove-section name
<em>git config</em> [&lt;file-option&gt;] [--show-origin] [-z|--null] [--name-only] -l | --list
<em>git config</em> [&lt;file-option&gt;] --get-color name [default]
<em>git config</em> [&lt;file-option&gt;] --get-colorbool name [stdout-is-tty]
<em>git config</em> [&lt;file-option&gt;] -e | --edit</pre>
<div class="attribution">
</div></div>
</div>
</div>
<div class="sect1">
<h2 id="_description">DESCRIPTION</h2>
<div class="sectionbody">
<div class="paragraph"><p>You can query/set/replace/unset options with this command. The name is
actually the section and the key separated by a dot, and the value will be
escaped.</p></div>
<div class="paragraph"><p>Multiple lines can be added to an option by using the <code>--add</code> option.
If you want to update or unset an option which can occur on multiple
lines, a POSIX regexp <code>value_regex</code> needs to be given. Only the
existing values that match the regexp are updated or unset. If
you want to handle the lines that do <strong>not</strong> match the regex, just
prepend a single exclamation mark in front (see also <a href="#EXAMPLES">[EXAMPLES]</a>).</p></div>
<div class="paragraph"><p>The <code>--type=&lt;type&gt;</code> option instructs <em>git config</em> to ensure that incoming and
outgoing values are canonicalize-able under the given &lt;type&gt;. If no
<code>--type=&lt;type&gt;</code> is given, no canonicalization will be performed. Callers may
unset an existing <code>--type</code> specifier with <code>--no-type</code>.</p></div>
<div class="paragraph"><p>When reading, the values are read from the system, global and
repository local configuration files by default, and options
<code>--system</code>, <code>--global</code>, <code>--local</code>, <code>--worktree</code> and
<code>--file &lt;filename&gt;</code> can be used to tell the command to read from only
that location (see <a href="#FILES">[FILES]</a>).</p></div>
<div class="paragraph"><p>When writing, the new value is written to the repository local
configuration file by default, and options <code>--system</code>, <code>--global</code>,
<code>--worktree</code>, <code>--file &lt;filename&gt;</code> can be used to tell the command to
write to that location (you can say <code>--local</code> but that is the
default).</p></div>
<div class="paragraph"><p>This command will fail with non-zero status upon error. Some exit
codes are:</p></div>
<div class="ulist"><ul>
<li>
<p>
The section or key is invalid (ret=1),
</p>
</li>
<li>
<p>
no section or name was provided (ret=2),
</p>
</li>
<li>
<p>
the config file is invalid (ret=3),
</p>
</li>
<li>
<p>
the config file cannot be written (ret=4),
</p>
</li>
<li>
<p>
you try to unset an option which does not exist (ret=5),
</p>
</li>
<li>
<p>
you try to unset/set an option for which multiple lines match (ret=5), or
</p>
</li>
<li>
<p>
you try to use an invalid regexp (ret=6).
</p>
</li>
</ul></div>
<div class="paragraph"><p>On success, the command returns the exit code 0.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_options">OPTIONS</h2>
<div class="sectionbody">
<div class="dlist"><dl>
<dt class="hdlist1">
--replace-all
</dt>
<dd>
<p>
Default behavior is to replace at most one line. This replaces
all lines matching the key (and optionally the value_regex).
</p>
</dd>
<dt class="hdlist1">
--add
</dt>
<dd>
<p>
Adds a new line to the option without altering any existing
values. This is the same as providing <em>^$</em> as the value_regex
in <code>--replace-all</code>.
</p>
</dd>
<dt class="hdlist1">
--get
</dt>
<dd>
<p>
Get the value for a given key (optionally filtered by a regex
matching the value). Returns error code 1 if the key was not
found and the last value if multiple key values were found.
</p>
</dd>
<dt class="hdlist1">
--get-all
</dt>
<dd>
<p>
Like get, but returns all values for a multi-valued key.
</p>
</dd>
<dt class="hdlist1">
--get-regexp
</dt>
<dd>
<p>
Like --get-all, but interprets the name as a regular expression and
writes out the key names. Regular expression matching is currently
case-sensitive and done against a canonicalized version of the key
in which section and variable names are lowercased, but subsection
names are not.
</p>
</dd>
<dt class="hdlist1">
--get-urlmatch name URL
</dt>
<dd>
<p>
When given a two-part name section.key, the value for
section.&lt;url&gt;.key whose &lt;url&gt; part matches the best to the
given URL is returned (if no such key exists, the value for
section.key is used as a fallback). When given just the
section as name, do so for all the keys in the section and
list them. Returns error code 1 if no value is found.
</p>
</dd>
<dt class="hdlist1">
--global
</dt>
<dd>
<p>
For writing options: write to global <code>~/.gitconfig</code> file
rather than the repository <code>.git/config</code>, write to
<code>$XDG_CONFIG_HOME/git/config</code> file if this file exists and the
<code>~/.gitconfig</code> file doesn&#8217;t.
</p>
<div class="paragraph"><p>For reading options: read only from global <code>~/.gitconfig</code> and from
<code>$XDG_CONFIG_HOME/git/config</code> rather than from all available files.</p></div>
<div class="paragraph"><p>See also <a href="#FILES">[FILES]</a>.</p></div>
</dd>
<dt class="hdlist1">
--system
</dt>
<dd>
<p>
For writing options: write to system-wide
<code>$(prefix)/etc/gitconfig</code> rather than the repository
<code>.git/config</code>.
</p>
<div class="paragraph"><p>For reading options: read only from system-wide <code>$(prefix)/etc/gitconfig</code>
rather than from all available files.</p></div>
<div class="paragraph"><p>See also <a href="#FILES">[FILES]</a>.</p></div>
</dd>
<dt class="hdlist1">
--local
</dt>
<dd>
<p>
For writing options: write to the repository <code>.git/config</code> file.
This is the default behavior.
</p>
<div class="paragraph"><p>For reading options: read only from the repository <code>.git/config</code> rather than
from all available files.</p></div>
<div class="paragraph"><p>See also <a href="#FILES">[FILES]</a>.</p></div>
</dd>
<dt class="hdlist1">
--worktree
</dt>
<dd>
<p>
Similar to <code>--local</code> except that <code>.git/config.worktree</code> is
read from or written to if <code>extensions.worktreeConfig</code> is
present. If not it&#8217;s the same as <code>--local</code>.
</p>
</dd>
<dt class="hdlist1">
-f config-file
</dt>
<dt class="hdlist1">
--file config-file
</dt>
<dd>
<p>
Use the given config file instead of the one specified by GIT_CONFIG.
</p>
</dd>
<dt class="hdlist1">
--blob blob
</dt>
<dd>
<p>
Similar to <code>--file</code> but use the given blob instead of a file. E.g.
you can use <em>master:.gitmodules</em> to read values from the file
<em>.gitmodules</em> in the master branch. See "SPECIFYING REVISIONS"
section in <a href="gitrevisions.html">gitrevisions(7)</a> for a more complete list of
ways to spell blob names.
</p>
</dd>
<dt class="hdlist1">
--remove-section
</dt>
<dd>
<p>
Remove the given section from the configuration file.
</p>
</dd>
<dt class="hdlist1">
--rename-section
</dt>
<dd>
<p>
Rename the given section to a new name.
</p>
</dd>
<dt class="hdlist1">
--unset
</dt>
<dd>
<p>
Remove the line matching the key from config file.
</p>
</dd>
<dt class="hdlist1">
--unset-all
</dt>
<dd>
<p>
Remove all lines matching the key from config file.
</p>
</dd>
<dt class="hdlist1">
-l
</dt>
<dt class="hdlist1">
--list
</dt>
<dd>
<p>
List all variables set in config file, along with their values.
</p>
</dd>
<dt class="hdlist1">
--type &lt;type&gt;
</dt>
<dd>
<p>
<em>git config</em> will ensure that any input or output is valid under the given
type constraint(s), and will canonicalize outgoing values in <code>&lt;type&gt;</code>'s
canonical form.
</p>
<div class="paragraph"><p>Valid <code>&lt;type&gt;</code>'s include:</p></div>
<div class="ulist"><ul>
<li>
<p>
<em>bool</em>: canonicalize values as either "true" or "false".
</p>
</li>
<li>
<p>
<em>int</em>: canonicalize values as simple decimal numbers. An optional suffix of
<em>k</em>, <em>m</em>, or <em>g</em> will cause the value to be multiplied by 1024, 1048576, or
1073741824 upon input.
</p>
</li>
<li>
<p>
<em>bool-or-int</em>: canonicalize according to either <em>bool</em> or <em>int</em>, as described
above.
</p>
</li>
<li>
<p>
<em>path</em>: canonicalize by adding a leading <code>~</code> to the value of <code>$HOME</code> and
<code>~user</code> to the home directory for the specified user. This specifier has no
effect when setting the value (but you can use <code>git config section.variable
~/</code> from the command line to let your shell do the expansion.)
</p>
</li>
<li>
<p>
<em>expiry-date</em>: canonicalize by converting from a fixed or relative date-string
to a timestamp. This specifier has no effect when setting the value.
</p>
</li>
<li>
<p>
<em>color</em>: When getting a value, canonicalize by converting to an ANSI color
escape sequence. When setting a value, a sanity-check is performed to ensure
that the given value is canonicalize-able as an ANSI color, but it is written
as-is.
</p>
</li>
</ul></div>
</dd>
<dt class="hdlist1">
--bool
</dt>
<dt class="hdlist1">
--int
</dt>
<dt class="hdlist1">
--bool-or-int
</dt>
<dt class="hdlist1">
--path
</dt>
<dt class="hdlist1">
--expiry-date
</dt>
<dd>
<p>
Historical options for selecting a type specifier. Prefer instead <code>--type</code>
(see above).
</p>
</dd>
<dt class="hdlist1">
--no-type
</dt>
<dd>
<p>
Un-sets the previously set type specifier (if one was previously set). This
option requests that <em>git config</em> not canonicalize the retrieved variable.
<code>--no-type</code> has no effect without <code>--type=&lt;type&gt;</code> or <code>--&lt;type&gt;</code>.
</p>
</dd>
<dt class="hdlist1">
-z
</dt>
<dt class="hdlist1">
--null
</dt>
<dd>
<p>
For all options that output values and/or keys, always
end values with the null character (instead of a
newline). Use newline instead as a delimiter between
key and value. This allows for secure parsing of the
output without getting confused e.g. by values that
contain line breaks.
</p>
</dd>
<dt class="hdlist1">
--name-only
</dt>
<dd>
<p>
Output only the names of config variables for <code>--list</code> or
<code>--get-regexp</code>.
</p>
</dd>
<dt class="hdlist1">
--show-origin
</dt>
<dd>
<p>
Augment 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).
</p>
</dd>
<dt class="hdlist1">
--get-colorbool name [stdout-is-tty]
</dt>
<dd>
<p>
Find the color setting for <code>name</code> (e.g. <code>color.diff</code>) and output
"true" or "false". <code>stdout-is-tty</code> should be either "true" or
"false", and is taken into account when configuration says
"auto". If <code>stdout-is-tty</code> is missing, then checks the standard
output of the command itself, and exits with status 0 if color
is to be used, or exits with status 1 otherwise.
When the color setting for <code>name</code> is undefined, the command uses
<code>color.ui</code> as fallback.
</p>
</dd>
<dt class="hdlist1">
--get-color name [default]
</dt>
<dd>
<p>
Find the color configured for <code>name</code> (e.g. <code>color.diff.new</code>) and
output it as the ANSI color escape sequence to the standard
output. The optional <code>default</code> parameter is used instead, if
there is no color configured for <code>name</code>.
</p>
<div class="paragraph"><p><code>--type=color [--default=&lt;default&gt;]</code> is preferred over <code>--get-color</code>.</p></div>
</dd>
<dt class="hdlist1">
-e
</dt>
<dt class="hdlist1">
--edit
</dt>
<dd>
<p>
Opens an editor to modify the specified config file; either
<code>--system</code>, <code>--global</code>, or repository (default).
</p>
</dd>
<dt class="hdlist1">
--[no-]includes
</dt>
<dd>
<p>
Respect <code>include.*</code> directives in config files when looking up
values. Defaults to <code>off</code> when a specific file is given (e.g.,
using <code>--file</code>, <code>--global</code>, etc) and <code>on</code> when searching all
config files.
</p>
</dd>
<dt class="hdlist1">
--default &lt;value&gt;
</dt>
<dd>
<p>
When using <code>--get</code>, and the requested variable is not found, behave as if
&lt;value&gt; were the value assigned to the that variable.
</p>
</dd>
</dl></div>
</div>
</div>
<div class="sect1">
<h2 id="_configuration">CONFIGURATION</h2>
<div class="sectionbody">
<div class="paragraph"><p><code>pager.config</code> is only respected when listing configuration, i.e., when
using <code>--list</code> or any of the <code>--get-*</code> which may return multiple results.
The default is to use a pager.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="FILES">FILES</h2>
<div class="sectionbody">
<div class="paragraph"><p>If not set explicitly with <code>--file</code>, there are four files where
<em>git config</em> will search for configuration options:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
$(prefix)/etc/gitconfig
</dt>
<dd>
<p>
System-wide configuration file.
</p>
</dd>
<dt class="hdlist1">
$XDG_CONFIG_HOME/git/config
</dt>
<dd>
<p>
Second user-specific configuration file. If $XDG_CONFIG_HOME is not set
or empty, <code>$HOME/.config/git/config</code> will be used. Any single-valued
variable set in this file will be overwritten by whatever is in
<code>~/.gitconfig</code>. It is a good idea not to create this file if
you sometimes use older versions of Git, as support for this
file was added fairly recently.
</p>
</dd>
<dt class="hdlist1">
~/.gitconfig
</dt>
<dd>
<p>
User-specific configuration file. Also called "global"
configuration file.
</p>
</dd>
<dt class="hdlist1">
$GIT_DIR/config
</dt>
<dd>
<p>
Repository specific configuration file.
</p>
</dd>
<dt class="hdlist1">
$GIT_DIR/config.worktree
</dt>
<dd>
<p>
This is optional and is only searched when
<code>extensions.worktreeConfig</code> is present in $GIT_DIR/config.
</p>
</dd>
</dl></div>
<div class="paragraph"><p>If no further options are given, all reading options will read all of these
files that are available. If the global or the system-wide configuration
file are not available they will be ignored. If the repository configuration
file is not available or readable, <em>git config</em> will exit with a non-zero
error code. However, in neither case will an error message be issued.</p></div>
<div class="paragraph"><p>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.</p></div>
<div class="paragraph"><p>You may override individual configuration parameters when running any git
command by using the <code>-c</code> option. See <a href="git.html">git(1)</a> for details.</p></div>
<div class="paragraph"><p>All writing options will per default write to the repository specific
configuration file. Note that this also affects options like <code>--replace-all</code>
and <code>--unset</code>. <strong><em>git config</em> will only ever change one file at a time</strong>.</p></div>
<div class="paragraph"><p>You can override these rules either by command-line options or by environment
variables. The <code>--global</code>, <code>--system</code> and <code>--worktree</code> options will limit
the file used to the global, system-wide or per-worktree file respectively.
The <code>GIT_CONFIG</code> environment variable has a similar effect, but you
can specify any filename you want.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_environment">ENVIRONMENT</h2>
<div class="sectionbody">
<div class="dlist"><dl>
<dt class="hdlist1">
GIT_CONFIG
</dt>
<dd>
<p>
Take the configuration from the given file instead of .git/config.
Using the "--global" option forces this to ~/.gitconfig. Using the
"--system" option forces this to $(prefix)/etc/gitconfig.
</p>
</dd>
<dt class="hdlist1">
GIT_CONFIG_NOSYSTEM
</dt>
<dd>
<p>
Whether to skip reading settings from the system-wide
$(prefix)/etc/gitconfig file. See <a href="git.html">git(1)</a> for details.
</p>
</dd>
</dl></div>
<div class="paragraph"><p>See also <a href="#FILES">[FILES]</a>.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="EXAMPLES">EXAMPLES</h2>
<div class="sectionbody">
<div class="paragraph"><p>Given a .git/config like this:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>#
# This is the config file, and
# a '#' or ';' character indicates
# a comment
#</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>; core variables
[core]
; Don't trust file modes
filemode = false</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>; Our diff algorithm
[diff]
external = /usr/local/bin/diff-wrapper
renames = true</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>; Proxy settings
[core]
gitproxy=proxy-command for kernel.org
gitproxy=default-proxy ; for all the rest</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>; HTTP
[http]
sslVerify
[http "https://weak.example.com"]
sslVerify = false
cookieFile = /tmp/cookie.txt</code></pre>
</div></div>
<div class="paragraph"><p>you can set the filemode to true with</p></div>
<div class="listingblock">
<div class="content">
<pre><code>% git config core.filemode true</code></pre>
</div></div>
<div class="paragraph"><p>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".</p></div>
<div class="listingblock">
<div class="content">
<pre><code>% git config core.gitproxy '"ssh" for kernel.org' 'for kernel.org$'</code></pre>
</div></div>
<div class="paragraph"><p>This makes sure that only the key/value pair for kernel.org is replaced.</p></div>
<div class="paragraph"><p>To delete the entry for renames, do</p></div>
<div class="listingblock">
<div class="content">
<pre><code>% git config --unset diff.renames</code></pre>
</div></div>
<div class="paragraph"><p>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.</p></div>
<div class="paragraph"><p>To query the value for a given key, do</p></div>
<div class="listingblock">
<div class="content">
<pre><code>% git config --get core.filemode</code></pre>
</div></div>
<div class="paragraph"><p>or</p></div>
<div class="listingblock">
<div class="content">
<pre><code>% git config core.filemode</code></pre>
</div></div>
<div class="paragraph"><p>or, to query a multivar:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>% git config --get core.gitproxy "for kernel.org$"</code></pre>
</div></div>
<div class="paragraph"><p>If you want to know all the values for a multivar, do:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>% git config --get-all core.gitproxy</code></pre>
</div></div>
<div class="paragraph"><p>If you like to live dangerously, you can replace <strong>all</strong> core.gitproxy by a
new one with</p></div>
<div class="listingblock">
<div class="content">
<pre><code>% git config --replace-all core.gitproxy ssh</code></pre>
</div></div>
<div class="paragraph"><p>However, if you really only want to replace the line for the default proxy,
i.e. the one without a "for &#8230;" postfix, do something like this:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>% git config core.gitproxy ssh '! for '</code></pre>
</div></div>
<div class="paragraph"><p>To actually match only values with an exclamation mark, you have to</p></div>
<div class="listingblock">
<div class="content">
<pre><code>% git config section.key value '[!]'</code></pre>
</div></div>
<div class="paragraph"><p>To add a new proxy, without altering any of the existing ones, use</p></div>
<div class="listingblock">
<div class="content">
<pre><code>% git config --add core.gitproxy '"proxy-command" for example.com'</code></pre>
</div></div>
<div class="paragraph"><p>An example to use customized color from the configuration in your
script:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>#!/bin/sh
WS=$(git config --get-color color.diff.whitespace "blue reverse")
RESET=$(git config --get-color "" "reset")
echo "${WS}your whitespace color or blue reverse${RESET}"</code></pre>
</div></div>
<div class="paragraph"><p>For URLs in <code>https://weak.example.com</code>, <code>http.sslVerify</code> is set to
false, while it is set to <code>true</code> for all others:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>% git config --type=bool --get-urlmatch http.sslverify https://good.example.com
true
% git config --type=bool --get-urlmatch http.sslverify https://weak.example.com
false
% git config --get-urlmatch http https://weak.example.com
http.cookieFile /tmp/cookie.txt
http.sslverify false</code></pre>
</div></div>
</div>
</div>
<div class="sect1">
<h2 id="_configuration_file">CONFIGURATION FILE</h2>
<div class="sectionbody">
<div class="paragraph"><p>The Git configuration file contains a number of variables that affect
the Git commands' behavior. The files <code>.git/config</code> and optionally
<code>config.worktree</code> (see <code>extensions.worktreeConfig</code> below) in each
repository are used to store the configuration for that repository, and
<code>$HOME/.gitconfig</code> is used to store a per-user configuration as
fallback values for the <code>.git/config</code> file. The file <code>/etc/gitconfig</code>
can be used to store a system-wide default configuration.</p></div>
<div class="paragraph"><p>The configuration variables are used by both the Git plumbing
and the porcelains. 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 <code>-</code>, and must start with an alphabetic character. Some
variables may appear multiple times; we say then that the variable is
multivalued.</p></div>
<div class="sect2">
<h3 id="_syntax">Syntax</h3>
<div class="paragraph"><p>The syntax is fairly flexible and permissive; whitespaces are mostly
ignored. The <em>#</em> and <em>;</em> characters begin comments to the end of line,
blank lines are ignored.</p></div>
<div class="paragraph"><p>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, <code>-</code> and <code>.</code> 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.</p></div>
<div class="paragraph"><p>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:</p></div>
<div class="listingblock">
<div class="content">
<pre><code> [section "subsection"]</code></pre>
</div></div>
<div class="paragraph"><p>Subsection names are case sensitive and can contain any characters except
newline and the null byte. Doublequote <code>"</code> and backslash can be included
by escaping them as <code>\"</code> and <code>\\</code>, respectively. Backslashes preceding
other characters are dropped when reading; for example, <code>\t</code> is read as
<code>t</code> and <code>\0</code> is read as <code>0</code> Section headers cannot span multiple lines.
Variables may belong directly to a section or to a given subsection. You
can have <code>[section]</code> if you have <code>[section "subsection"]</code>, but you don&#8217;t
need to.</p></div>
<div class="paragraph"><p>There is also a deprecated <code>[section.subsection]</code> 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.</p></div>
<div class="paragraph"><p>All the other lines (and the remainder of the line after the section
header) are recognized as setting variables, in the form
<em>name = value</em> (or just <em>name</em>, which is a short-hand to say that
the variable is the boolean "true").
The variable names are case-insensitive, allow only alphanumeric characters
and <code>-</code>, and must start with an alphabetic character.</p></div>
<div class="paragraph"><p>A line that defines a value can be continued to the next line by
ending it with a <code>\</code>; the backquote and the end-of-line are
stripped. Leading whitespaces after <em>name =</em>, the remainder of the
line after the first comment character <em>#</em> or <em>;</em>, and trailing
whitespaces of the line are discarded unless they are enclosed in
double quotes. Internal whitespaces within the value are retained
verbatim.</p></div>
<div class="paragraph"><p>Inside double quotes, double quote <code>"</code> and backslash <code>\</code> characters
must be escaped: use <code>\"</code> for <code>"</code> and <code>\\</code> for <code>\</code>.</p></div>
<div class="paragraph"><p>The following escape sequences (beside <code>\"</code> and <code>\\</code>) are recognized:
<code>\n</code> for newline character (NL), <code>\t</code> for horizontal tabulation (HT, TAB)
and <code>\b</code> for backspace (BS). Other char escape sequences (including octal
escape sequences) are invalid.</p></div>
</div>
<div class="sect2">
<h3 id="_includes">Includes</h3>
<div class="paragraph"><p>The <code>include</code> and <code>includeIf</code> sections allow you to include config
directives from another source. These sections behave identically to
each other with the exception that <code>includeIf</code> sections may be ignored
if their condition does not evaluate to true; see "Conditional includes"
below.</p></div>
<div class="paragraph"><p>You can include a config file from another by setting the special
<code>include.path</code> (or <code>includeIf.*.path</code>) 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.</p></div>
<div class="paragraph"><p>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.</p></div>
</div>
<div class="sect2">
<h3 id="_conditional_includes">Conditional includes</h3>
<div class="paragraph"><p>You can include a config file from another conditionally by setting a
<code>includeIf.&lt;condition&gt;.path</code> variable to the name of the file to be
included.</p></div>
<div class="paragraph"><p>The condition starts with a keyword followed by a colon and some data
whose format and meaning depends on the keyword. Supported keywords
are:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<code>gitdir</code>
</dt>
<dd>
<p>
The data that follows the keyword <code>gitdir:</code> is used as a glob
pattern. If the location of the .git directory matches the
pattern, the include condition is met.
</p>
<div class="paragraph"><p>The .git location may be auto-discovered, or come from <code>$GIT_DIR</code>
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.</p></div>
<div class="paragraph"><p>The pattern can contain standard globbing wildcards and two additional
ones, <code>**/</code> and <code>/**</code>, that can match multiple path components. Please
refer to <a href="gitignore.html">gitignore(5)</a> for details. For convenience:</p></div>
<div class="ulist"><ul>
<li>
<p>
If the pattern starts with <code>~/</code>, <code>~</code> will be substituted with the
content of the environment variable <code>HOME</code>.
</p>
</li>
<li>
<p>
If the pattern starts with <code>./</code>, it is replaced with the directory
containing the current config file.
</p>
</li>
<li>
<p>
If the pattern does not start with either <code>~/</code>, <code>./</code> or <code>/</code>, <code>**/</code>
will be automatically prepended. For example, the pattern <code>foo/bar</code>
becomes <code>**/foo/bar</code> and would match <code>/any/path/to/foo/bar</code>.
</p>
</li>
<li>
<p>
If the pattern ends with <code>/</code>, <code>**</code> will be automatically added. For
example, the pattern <code>foo/</code> becomes <code>foo/**</code>. In other words, it
matches "foo" and everything inside, recursively.
</p>
</li>
</ul></div>
</dd>
<dt class="hdlist1">
<code>gitdir/i</code>
</dt>
<dd>
<p>
This is the same as <code>gitdir</code> except that matching is done
case-insensitively (e.g. on case-insensitive file sytems)
</p>
</dd>
</dl></div>
<div class="paragraph"><p>A few more notes on matching via <code>gitdir</code> and <code>gitdir/i</code>:</p></div>
<div class="ulist"><ul>
<li>
<p>
Symlinks in <code>$GIT_DIR</code> are not resolved before matching.
</p>
</li>
<li>
<p>
Both the symlink &amp; realpath versions of paths will be matched
outside of <code>$GIT_DIR</code>. E.g. if ~/git is a symlink to
/mnt/storage/git, both <code>gitdir:~/git</code> and <code>gitdir:/mnt/storage/git</code>
will match.
</p>
<div class="paragraph"><p>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.</p></div>
</li>
<li>
<p>
Note that "../" is not special and will match literally, which is
unlikely what you want.
</p>
</li>
</ul></div>
</div>
<div class="sect2">
<h3 id="_example">Example</h3>
<div class="literalblock">
<div class="content">
<pre><code># Core variables
[core]
; Don't trust file modes
filemode = false</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code># Our diff algorithm
[diff]
external = /usr/local/bin/diff-wrapper
renames = true</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>[branch "devel"]
remote = origin
merge = refs/heads/devel</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code># Proxy settings
[core]
gitProxy="ssh" for "kernel.org"
gitProxy=default-proxy ; for the rest</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>[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</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>; include if $GIT_DIR is /path/to/foo/.git
[includeIf "gitdir:/path/to/foo/.git"]
path = /path/to/foo.inc</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>; include for all repositories inside /path/to/group
[includeIf "gitdir:/path/to/group/"]
path = /path/to/foo.inc</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>; include for all repositories inside $HOME/to/group
[includeIf "gitdir:~/to/group/"]
path = /path/to/foo.inc</code></pre>
</div></div>
<div class="literalblock">
<div class="content">
<pre><code>; 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</code></pre>
</div></div>
</div>
<div class="sect2">
<h3 id="_values">Values</h3>
<div class="paragraph"><p>Values of many variables are treated as a simple string, but there
are variables that take values of specific types and there are rules
as to how to spell them.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
boolean
</dt>
<dd>
<p>
When a variable is said to take a boolean value, many
synonyms are accepted for <em>true</em> and <em>false</em>; these are all
case-insensitive.
</p>
<div class="dlist"><dl>
<dt class="hdlist1">
true
</dt>
<dd>
<p>
Boolean true literals are <code>yes</code>, <code>on</code>, <code>true</code>,
and <code>1</code>. Also, a variable defined without <code>= &lt;value&gt;</code>
is taken as true.
</p>
</dd>
<dt class="hdlist1">
false
</dt>
<dd>
<p>
Boolean false literals are <code>no</code>, <code>off</code>, <code>false</code>,
<code>0</code> and the empty string.
</p>
<div class="paragraph"><p>When converting a value to its canonical form using the <code>--type=bool</code> type
specifier, <em>git config</em> will ensure that the output is "true" or
"false" (spelled in lowercase).</p></div>
</dd>
</dl></div>
</dd>
<dt class="hdlist1">
integer
</dt>
<dd>
<p>
The value for many variables that specify various sizes can
be suffixed with <code>k</code>, <code>M</code>,&#8230; to mean "scale the number by
1024", "by 1024x1024", etc.
</p>
</dd>
<dt class="hdlist1">
color
</dt>
<dd>
<p>
The value for a variable that takes a color is a list of
colors (at most two, one for foreground and one for background)
and attributes (as many as you want), separated by spaces.
</p>
<div class="paragraph"><p>The basic colors accepted are <code>normal</code>, <code>black</code>, <code>red</code>, <code>green</code>, <code>yellow</code>,
<code>blue</code>, <code>magenta</code>, <code>cyan</code> and <code>white</code>. The first color given is the
foreground; the second is the background.</p></div>
<div class="paragraph"><p>Colors may also be given as numbers between 0 and 255; these use ANSI
256-color mode (but note that not all terminals may support this). If
your terminal supports it, you may also specify 24-bit RGB values as
hex, like <code>#ff0ab3</code>.</p></div>
<div class="paragraph"><p>The accepted attributes are <code>bold</code>, <code>dim</code>, <code>ul</code>, <code>blink</code>, <code>reverse</code>,
<code>italic</code>, and <code>strike</code> (for crossed-out or "strikethrough" letters).
The position of any attributes with respect to the colors
(before, after, or in between), doesn&#8217;t matter. Specific attributes may
be turned off by prefixing them with <code>no</code> or <code>no-</code> (e.g., <code>noreverse</code>,
<code>no-ul</code>, etc).</p></div>
<div class="paragraph"><p>An empty color string produces no color effect at all. This can be used
to avoid coloring specific elements without disabling color entirely.</p></div>
<div class="paragraph"><p>For git&#8217;s pre-defined color slots, the attributes are meant to be reset
at the beginning of each item in the colored output. So setting
<code>color.decorate.branch</code> to <code>black</code> will paint that branch name in a
plain <code>black</code>, even if the previous thing on the same output line (e.g.
opening parenthesis before the list of branch names in <code>log --decorate</code>
output) is set to be painted with <code>bold</code> or some other attribute.
However, custom log formats may do more complicated and layered
coloring, and the negated forms may be useful there.</p></div>
</dd>
<dt class="hdlist1">
pathname
</dt>
<dd>
<p>
A variable that takes a pathname value can be given a
string that begins with "<code>~/</code>" or "<code>~user/</code>", and the usual
tilde expansion happens to such a string: <code>~/</code>
is expanded to the value of <code>$HOME</code>, and <code>~user/</code> to the
specified user&#8217;s home directory.
</p>
</dd>
</dl></div>
</div>
<div class="sect2">
<h3 id="_variables">Variables</h3>
<div class="paragraph"><p>Note that this list is non-comprehensive and not necessarily complete.
For command-specific variables, you will find a more detailed description
in the appropriate manual page.</p></div>
<div class="paragraph"><p>Other git-related tools may and do use their own variables. When
inventing new variables for use in your own tool, make sure their
names do not conflict with those that are used by Git itself and
other popular tools, and describe them in your documentation.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
advice.*
</dt>
<dd>
<p>
These variables control various optional help messages designed to
aid new users. All <em>advice.*</em> variables default to <em>true</em>, and you
can tell Git that you do not need help by setting these to <em>false</em>:
</p>
<div class="openblock">
<div class="content">
<div class="dlist"><dl>
<dt class="hdlist1">
pushUpdateRejected
</dt>
<dd>
<p>
Set this variable to <em>false</em> if you want to disable
<em>pushNonFFCurrent</em>,
<em>pushNonFFMatching</em>, <em>pushAlreadyExists</em>,
<em>pushFetchFirst</em>, and <em>pushNeedsForce</em>
simultaneously.
</p>
</dd>
<dt class="hdlist1">
pushNonFFCurrent
</dt>
<dd>
<p>
Advice shown when <a href="git-push.html">git-push(1)</a> fails due to a
non-fast-forward update to the current branch.
</p>
</dd>
<dt class="hdlist1">
pushNonFFMatching
</dt>
<dd>
<p>
Advice shown when you ran <a href="git-push.html">git-push(1)</a> and pushed
<em>matching refs</em> explicitly (i.e. you used <em>:</em>, or
specified a refspec that isn&#8217;t your current branch) and
it resulted in a non-fast-forward error.
</p>
</dd>
<dt class="hdlist1">
pushAlreadyExists
</dt>
<dd>
<p>
Shown when <a href="git-push.html">git-push(1)</a> rejects an update that
does not qualify for fast-forwarding (e.g., a tag.)
</p>
</dd>
<dt class="hdlist1">
pushFetchFirst
</dt>
<dd>
<p>
Shown when <a href="git-push.html">git-push(1)</a> rejects an update that
tries to overwrite a remote ref that points at an
object we do not have.
</p>
</dd>
<dt class="hdlist1">
pushNeedsForce
</dt>
<dd>
<p>
Shown when <a href="git-push.html">git-push(1)</a> 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.
</p>
</dd>
<dt class="hdlist1">
statusHints
</dt>
<dd>
<p>
Show directions on how to proceed from the current
state in the output of <a href="git-status.html">git-status(1)</a>, in
the template shown when writing commit messages in
<a href="git-commit.html">git-commit(1)</a>, and in the help message shown
by <a href="git-checkout.html">git-checkout(1)</a> when switching branch.
</p>
</dd>
<dt class="hdlist1">
statusUoption
</dt>
<dd>
<p>
Advise to consider using the <code>-u</code> option to <a href="git-status.html">git-status(1)</a>
when the command takes more than 2 seconds to enumerate untracked
files.
</p>
</dd>
<dt class="hdlist1">
commitBeforeMerge
</dt>
<dd>
<p>
Advice shown when <a href="git-merge.html">git-merge(1)</a> refuses to
merge to avoid overwriting local changes.
</p>
</dd>
<dt class="hdlist1">
resetQuiet
</dt>
<dd>
<p>
Advice to consider using the <code>--quiet</code> option to <a href="git-reset.html">git-reset(1)</a>
when the command takes more than 2 seconds to enumerate unstaged
changes after reset.
</p>
</dd>
<dt class="hdlist1">
resolveConflict
</dt>
<dd>
<p>
Advice shown by various commands when conflicts
prevent the operation from being performed.
</p>
</dd>
<dt class="hdlist1">
implicitIdentity
</dt>
<dd>
<p>
Advice on how to set your identity configuration when
your information is guessed from the system username and
domain name.
</p>
</dd>
<dt class="hdlist1">
detachedHead
</dt>
<dd>
<p>
Advice shown when you used <a href="git-checkout.html">git-checkout(1)</a> to
move to the detach HEAD state, to instruct how to create
a local branch after the fact.
</p>
</dd>
<dt class="hdlist1">
checkoutAmbiguousRemoteBranchName
</dt>
<dd>
<p>
Advice shown when the argument to
<a href="git-checkout.html">git-checkout(1)</a> 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 the <code>checkout.defaultRemote</code>
configuration variable for how to set a given remote
to used by default in some situations where this
advice would be printed.
</p>
</dd>
<dt class="hdlist1">
amWorkDir
</dt>
<dd>
<p>
Advice that shows the location of the patch file when
<a href="git-am.html">git-am(1)</a> fails to apply it.
</p>
</dd>
<dt class="hdlist1">
rmHints
</dt>
<dd>
<p>
In case of failure in the output of <a href="git-rm.html">git-rm(1)</a>,
show directions on how to proceed from the current state.
</p>
</dd>
<dt class="hdlist1">
addEmbeddedRepo
</dt>
<dd>
<p>
Advice on what to do when you&#8217;ve accidentally added one
git repo inside of another.
</p>
</dd>
<dt class="hdlist1">
ignoredHook
</dt>
<dd>
<p>
Advice shown if a hook is ignored because the hook is not
set as executable.
</p>
</dd>
<dt class="hdlist1">
waitingForEditor
</dt>
<dd>
<p>
Print a message to the terminal whenever Git is waiting for
editor input from the user.
</p>
</dd>
</dl></div>
</div></div>
</dd>
<dt class="hdlist1">
core.fileMode
</dt>
<dd>
<p>
Tells Git if the executable bit of files in the working tree
is to be honored.
</p>
<div class="paragraph"><p>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.
<a href="git-clone.html">git-clone(1)</a> or <a href="git-init.html">git-init(1)</a> probe the filesystem
to see if it handles the executable bit correctly
and this variable is automatically set as necessary.</p></div>
<div class="paragraph"><p>A repository, however, may be on a filesystem that handles
the filemode correctly, and this variable is set to <em>true</em>
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 <em>false</em>.
See <a href="git-update-index.html">git-update-index(1)</a>.</p></div>
<div class="paragraph"><p>The default is true (when core.filemode is not specified in the config file).</p></div>
</dd>
<dt class="hdlist1">
core.hideDotFiles
</dt>
<dd>
<p>
(Windows-only) If true, mark newly-created directories and files whose
name starts with a dot as hidden. If <em>dotGitOnly</em>, only the <code>.git/</code>
directory is hidden, but no other files starting with a dot. The
default mode is <em>dotGitOnly</em>.
</p>
</dd>
<dt class="hdlist1">
core.ignoreCase
</dt>
<dd>
<p>
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".
</p>
<div class="paragraph"><p>The default is false, except <a href="git-clone.html">git-clone(1)</a> or <a href="git-init.html">git-init(1)</a>
will probe and set core.ignoreCase true if appropriate when the repository
is created.</p></div>
<div class="paragraph"><p>Git relies on the proper configuration of this variable for your operating
and file system. Modifying this value may result in unexpected behavior.</p></div>
</dd>
<dt class="hdlist1">
core.precomposeUnicode
</dt>
<dd>
<p>
This option is only used by Mac OS implementation of Git.
When core.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).
When false, file names are handled fully transparent by Git,
which is backward compatible with older versions of Git.
</p>
</dd>
<dt class="hdlist1">
core.protectHFS
</dt>
<dd>
<p>
If set to true, do not allow checkout of paths that would
be considered equivalent to <code>.git</code> on an HFS+ filesystem.
Defaults to <code>true</code> on Mac OS, and <code>false</code> elsewhere.
</p>
</dd>
<dt class="hdlist1">
core.protectNTFS
</dt>
<dd>
<p>
If set to true, do not allow checkout of paths that would
cause problems with the NTFS filesystem, e.g. conflict with
8.3 "short" names.
Defaults to <code>true</code> on Windows, and <code>false</code> elsewhere.
</p>
</dd>
<dt class="hdlist1">
core.fsmonitor
</dt>
<dd>
<p>
If set, the value of this variable is used as a command which
will identify all files that may have changed since the
requested date/time. This information is used to speed up git by
avoiding unnecessary processing of files that have not changed.
See the "fsmonitor-watchman" section of <a href="githooks.html">githooks(5)</a>.
</p>
</dd>
<dt class="hdlist1">
core.trustctime
</dt>
<dd>
<p>
If false, the ctime differences between the index and the
working tree are ignored; useful when the inode change time
is regularly modified by something outside Git (file system
crawlers and some backup systems).
See <a href="git-update-index.html">git-update-index(1)</a>. True by default.
</p>
</dd>
<dt class="hdlist1">
core.splitIndex
</dt>
<dd>
<p>
If true, the split-index feature of the index will be used.
See <a href="git-update-index.html">git-update-index(1)</a>. False by default.
</p>
</dd>
<dt class="hdlist1">
core.untrackedCache
</dt>
<dd>
<p>
Determines what to do about the untracked cache feature of the
index. It will be kept, if this variable is unset or set to
<code>keep</code>. It will automatically be added if set to <code>true</code>. And
it will automatically be removed, if set to <code>false</code>. Before
setting it to <code>true</code>, you should check that mtime is working
properly on your system.
See <a href="git-update-index.html">git-update-index(1)</a>. <code>keep</code> by default.
</p>
</dd>
<dt class="hdlist1">
core.checkStat
</dt>
<dd>
<p>
When missing or is set to <code>default</code>, 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 <code>minimal</code>, 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 <code>core.trustCtime</code>
is set) and the filesize to be checked.
</p>
<div class="paragraph"><p>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 <code>minimal</code> mode may help interoperability when the
same repository is used by these other systems at the same time.</p></div>
</dd>
<dt class="hdlist1">
core.quotePath
</dt>
<dd>
<p>
Commands that output paths (e.g. <em>ls-files</em>, <em>diff</em>), 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.
<code>\t</code> for TAB, <code>\n</code> for LF, <code>\\</code> for backslash) or bytes with
values larger than 0x80 (e.g. octal <code>\302\265</code> 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 <code>-z</code> option. The default value
is true.
</p>
</dd>
<dt class="hdlist1">
core.eol
</dt>
<dd>
<p>
Sets the line ending type to use in the working directory for
files that have the <code>text</code> property set when core.autocrlf is false.
Alternatives are <em>lf</em>, <em>crlf</em> and <em>native</em>, which uses the platform&#8217;s
native line ending. The default value is <code>native</code>. See
<a href="gitattributes.html">gitattributes(5)</a> for more information on end-of-line
conversion.
</p>
</dd>
<dt class="hdlist1">
core.safecrlf
</dt>
<dd>
<p>
If true, makes Git check if converting <code>CRLF</code> 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
<code>core.autocrlf</code>, 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.
</p>
<div class="paragraph"><p>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.</p></div>
<div class="paragraph"><p>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.</p></div>
<div class="paragraph"><p>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.</p></div>
<div class="paragraph"><p>Note, this safety check does not mean that a checkout will generate a
file identical to the original file for a different setting of
<code>core.eol</code> and <code>core.autocrlf</code>, but only for the current one. For
example, a text file with <code>LF</code> would be accepted with <code>core.eol=lf</code>
and could later be checked out with <code>core.eol=crlf</code>, in which case the
resulting file would contain <code>CRLF</code>, although the original file
contained <code>LF</code>. However, in both work trees the line endings would be
consistent, that is either all <code>LF</code> or all <code>CRLF</code>, but never mixed. A
file with mixed line endings would be reported by the <code>core.safecrlf</code>
mechanism.</p></div>
</dd>
<dt class="hdlist1">
core.autocrlf
</dt>
<dd>
<p>
Setting this variable to "true" is the same as setting
the <code>text</code> attribute to "auto" on all files and core.eol to "crlf".
Set to true if you want to have <code>CRLF</code> line endings in your
working directory and the repository has LF line endings.
This variable can be set to <em>input</em>,
in which case no output conversion is performed.
</p>
</dd>
<dt class="hdlist1">
core.checkRoundtripEncoding
</dt>
<dd>
<p>
A comma and/or whitespace separated list of encodings that Git
performs UTF-8 round trip checks on if they are used in an
<code>working-tree-encoding</code> attribute (see <a href="gitattributes.html">gitattributes(5)</a>).
The default value is <code>SHIFT-JIS</code>.
</p>
</dd>
<dt class="hdlist1">
core.symlinks
</dt>
<dd>
<p>
If false, symbolic links are checked out as small plain files that
contain the link text. <a href="git-update-index.html">git-update-index(1)</a> and
<a href="git-add.html">git-add(1)</a> will not change the recorded type to regular
file. Useful on filesystems like FAT that do not support
symbolic links.
</p>
<div class="paragraph"><p>The default is true, except <a href="git-clone.html">git-clone(1)</a> or <a href="git-init.html">git-init(1)</a>
will probe and set core.symlinks false if appropriate when the repository
is created.</p></div>
</dd>
<dt class="hdlist1">
core.gitProxy
</dt>
<dd>
<p>
A "proxy command" to execute (as <em>command host port</em>) instead
of establishing 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.
</p>
<div class="paragraph"><p>Can be overridden by the <code>GIT_PROXY_COMMAND</code> environment variable
(which always applies universally, without the special "for"
handling).</p></div>
<div class="paragraph"><p>The special string <code>none</code> 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.</p></div>
</dd>
<dt class="hdlist1">
core.sshCommand
</dt>
<dd>
<p>
If this variable is set, <code>git fetch</code> and <code>git push</code> will
use the specified command instead of <code>ssh</code> when they need to
connect to a remote system. The command is in the same form as
the <code>GIT_SSH_COMMAND</code> environment variable and is overridden
when the environment variable is set.
</p>
</dd>
<dt class="hdlist1">
core.ignoreStat
</dt>
<dd>
<p>
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.
</p>
<div class="paragraph"><p>When files are modified outside of Git, the user will need to stage
the modified files explicitly (e.g. see <em>Examples</em> section in
<a href="git-update-index.html">git-update-index(1)</a>).
Git will not normally detect changes to those files.</p></div>
<div class="paragraph"><p>This is useful on systems where lstat() calls are very slow, such as
CIFS/Microsoft Windows.</p></div>
<div class="paragraph"><p>False by default.</p></div>
</dd>
<dt class="hdlist1">
core.preferSymlinkRefs
</dt>
<dd>
<p>
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.
</p>
</dd>
<dt class="hdlist1">
core.alternateRefsCommand
</dt>
<dd>
<p>
When advertising tips of available history from an alternate, use the shell to
execute the specified command instead of <a href="git-for-each-ref.html">git-for-each-ref(1)</a>. 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 <code>git for-each-ref
--format='%(objectname)'</code>).
</p>
<div class="paragraph"><p>Note that you cannot generally put <code>git for-each-ref</code> 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).</p></div>
</dd>
<dt class="hdlist1">
core.alternateRefsPrefixes
</dt>
<dd>
<p>
When listing references from an alternate, list only references that begin
with the given prefix. Prefixes match as if they were given as arguments to
<a href="git-for-each-ref.html">git-for-each-ref(1)</a>. To list multiple prefixes, separate them with
whitespace. If <code>core.alternateRefsCommand</code> is set, setting
<code>core.alternateRefsPrefixes</code> has no effect.
</p>
</dd>
<dt class="hdlist1">
core.bare
</dt>
<dd>
<p>
If true this repository is assumed to be <em>bare</em> and has no
working directory associated with it. If this is the case a
number of commands that require a working directory will be
disabled, such as <a href="git-add.html">git-add(1)</a> or <a href="git-merge.html">git-merge(1)</a>.
</p>
<div class="paragraph"><p>This setting is automatically guessed by <a href="git-clone.html">git-clone(1)</a> or
<a href="git-init.html">git-init(1)</a> when the repository was created. By default a
repository that ends in "/.git" is assumed to be not bare (bare =
false), while all other repositories are assumed to be bare (bare
= true).</p></div>
</dd>
<dt class="hdlist1">
core.worktree
</dt>
<dd>
<p>
Set the path to the root of the working tree.
If <code>GIT_COMMON_DIR</code> environment variable is set, core.worktree
is ignored and not used for determining the root of working tree.
This can be overridden by the <code>GIT_WORK_TREE</code> environment
variable and the <code>--work-tree</code> command-line option.
The value can be an absolute path or relative to the path to
the .git directory, which is either specified by --git-dir
or GIT_DIR, or automatically discovered.
If --git-dir or GIT_DIR is specified but none of
--work-tree, GIT_WORK_TREE and core.worktree is specified,
the current working directory is regarded as the top level
of your working tree.
</p>
<div class="paragraph"><p>Note that 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" has
core.worktree set 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&#8217;s usual working tree).</p></div>
</dd>
<dt class="hdlist1">
core.logAllRefUpdates
</dt>
<dd>
<p>
Enable the reflog. Updates to a ref &lt;ref&gt; is logged to the file
"<code>$GIT_DIR/logs/&lt;ref&gt;</code>", 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 configuration
variable is set to <code>true</code>, missing "<code>$GIT_DIR/logs/&lt;ref&gt;</code>"
file is automatically created for branch heads (i.e. under
<code>refs/heads/</code>), remote refs (i.e. under <code>refs/remotes/</code>),
note refs (i.e. under <code>refs/notes/</code>), and the symbolic ref <code>HEAD</code>.
If it is set to <code>always</code>, then a missing reflog is automatically
created for any ref under <code>refs/</code>.
</p>
<div class="paragraph"><p>This information can be used to determine what commit
was the tip of a branch "2 days ago".</p></div>
<div class="paragraph"><p>This value is true by default in a repository that has
a working directory associated with it, and false by
default in a bare repository.</p></div>
</dd>
<dt class="hdlist1">
core.repositoryFormatVersion
</dt>
<dd>
<p>
Internal variable identifying the repository format and layout
version.
</p>
</dd>
<dt class="hdlist1">
core.sharedRepository
</dt>
<dd>
<p>
When <em>group</em> (or <em>true</em>), the repository is made shareable between
several users in a group (making sure all the files and objects are
group-writable). When <em>all</em> (or <em>world</em> or <em>everybody</em>), the
repository will be readable by all users, additionally to being
group-shareable. When <em>umask</em> (or <em>false</em>), Git will use permissions
reported by umask(2). When <em>0xxx</em>, where <em>0xxx</em> is an octal number,
files in the repository will have this mode value. <em>0xxx</em> will override
user&#8217;s umask value (whereas the other options will only override
requested parts of the user&#8217;s umask value). Examples: <em>0660</em> will make
the repo read/write-able for the owner and group, but inaccessible to
others (equivalent to <em>group</em> unless umask is e.g. <em>0022</em>). <em>0640</em> is a
repository that is group-readable but not group-writable.
See <a href="git-init.html">git-init(1)</a>. False by default.
</p>
</dd>
<dt class="hdlist1">
core.warnAmbiguousRefs
</dt>
<dd>
<p>
If true, Git will warn you if the ref name you passed it is ambiguous
and might match multiple refs in the repository. True by default.
</p>
</dd>
<dt class="hdlist1">
core.compression
</dt>
<dd>
<p>
An integer -1..9, indicating a default compression level.
-1 is the zlib default. 0 means no compression,
and 1..9 are various speed/size tradeoffs, 9 being slowest.
If set, this provides a default to other compression variables,
such as <code>core.looseCompression</code> and <code>pack.compression</code>.
</p>
</dd>
<dt class="hdlist1">
core.looseCompression
</dt>
<dd>
<p>
An integer -1..9, indicating the compression level for objects that
are not 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 (best speed).
</p>
</dd>
<dt class="hdlist1">
core.packedGitWindowSize
</dt>
<dd>
<p>
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&#8217;s
memory manager, but may improve performance when accessing
a large number of large pack files.
</p>
<div class="paragraph"><p>Default is 1 MiB if NO_MMAP was set at compile time, otherwise 32
MiB on 32 bit platforms and 1 GiB on 64 bit platforms. This should
be reasonable for all users/operating systems. You probably do
not need to adjust this value.</p></div>
<div class="paragraph"><p>Common unit suffixes of <em>k</em>, <em>m</em>, or <em>g</em> are supported.</p></div>
</dd>
<dt class="hdlist1">
core.packedGitLimit
</dt>
<dd>
<p>
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.
</p>
<div class="paragraph"><p>Default is 256 MiB on 32 bit platforms and 32 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.</p></div>
<div class="paragraph"><p>Common unit suffixes of <em>k</em>, <em>m</em>, or <em>g</em> are supported.</p></div>
</dd>
<dt class="hdlist1">
core.deltaBaseCacheLimit
</dt>
<dd>
<p>
Maximum number of bytes 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.
</p>
<div class="paragraph"><p>Default is 96 MiB on 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.</p></div>
<div class="paragraph"><p>Common unit suffixes of <em>k</em>, <em>m</em>, or <em>g</em> are supported.</p></div>
</dd>
<dt class="hdlist1">
core.bigFileThreshold
</dt>
<dd>
<p>
Files larger than this size are stored deflated, without
attempting delta compression. Storing large files without
delta compression avoids excessive memory usage, at the
slight expense of increased disk usage. Additionally files
larger than this size are always treated as binary.
</p>
<div class="paragraph"><p>Default is 512 MiB on all platforms. This should be reasonable
for most projects as source code and other text files can still
be delta compressed, but larger binary media files won&#8217;t be.</p></div>
<div class="paragraph"><p>Common unit suffixes of <em>k</em>, <em>m</em>, or <em>g</em> are supported.</p></div>
</dd>
<dt class="hdlist1">
core.excludesFile
</dt>
<dd>
<p>
Specifies the pathname to the file that contains patterns to
describe paths that are not meant to be tracked, in addition
to <em>.gitignore</em> (per-directory) and <em>.git/info/exclude</em>.
Defaults to <code>$XDG_CONFIG_HOME/git/ignore</code>.
If <code>$XDG_CONFIG_HOME</code> is either not set or empty, <code>$HOME/.config/git/ignore</code>
is used instead. See <a href="gitignore.html">gitignore(5)</a>.
</p>
</dd>
<dt class="hdlist1">
core.askPass
</dt>
<dd>
<p>
Some commands (e.g. svn and http interfaces) 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 the <code>GIT_ASKPASS</code>
environment variable. If not set, fall back to the value of the
<code>SSH_ASKPASS</code> environment 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 its STDOUT.
</p>
</dd>
<dt class="hdlist1">
core.attributesFile
</dt>
<dd>
<p>
In addition to <em>.gitattributes</em> (per-directory) and
<em>.git/info/attributes</em>, Git looks into this file for attributes
(see <a href="gitattributes.html">gitattributes(5)</a>). Path expansions are made the same
way as for <code>core.excludesFile</code>. Its default value is
<code>$XDG_CONFIG_HOME/git/attributes</code>. If <code>$XDG_CONFIG_HOME</code> is either not
set or empty, <code>$HOME/.config/git/attributes</code> is used instead.
</p>
</dd>
<dt class="hdlist1">
core.hooksPath
</dt>
<dd>
<p>
By default Git will look for your hooks in the
<em>$GIT_DIR/hooks</em> directory. Set this to different path,
e.g. <em>/etc/git/hooks</em>, and Git will try to find your hooks in
that directory, e.g. <em>/etc/git/hooks/pre-receive</em> instead of
in <em>$GIT_DIR/hooks/pre-receive</em>.
</p>
<div class="paragraph"><p>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 of <a href="githooks.html">githooks(5)</a>).</p></div>
<div class="paragraph"><p>This configuration variable is useful in cases where you&#8217;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 an <code>init.templateDir</code> where you&#8217;ve changed
default hooks.</p></div>
</dd>
<dt class="hdlist1">
core.editor
</dt>
<dd>
<p>
Commands such as <code>commit</code> and <code>tag</code> that let you edit
messages by launching an editor use the value of this
variable when it is set, and the environment variable
<code>GIT_EDITOR</code> is not set. See <a href="git-var.html">git-var(1)</a>.
</p>
</dd>
<dt class="hdlist1">
core.commentChar
</dt>
<dd>
<p>
Commands such as <code>commit</code> and <code>tag</code> that let you edit
messages consider a line that begins with this character
commented, and removes them after the editor returns
(default <em>#</em>).
</p>
<div class="paragraph"><p>If set to "auto", <code>git-commit</code> would select a character that is not
the beginning character of any line in existing commit messages.</p></div>
</dd>
<dt class="hdlist1">
core.filesRefLockTimeout
</dt>
<dd>
<p>
The length of time, in milliseconds, to retry when trying to
lock an individual reference. Value 0 means not to retry at
all; -1 means to try indefinitely. Default is 100 (i.e.,
retry for 100ms).
</p>
</dd>
<dt class="hdlist1">
core.packedRefsTimeout
</dt>
<dd>
<p>
The length of time, in milliseconds, to retry when trying to
lock the <code>packed-refs</code> file. Value 0 means not to retry at
all; -1 means to try indefinitely. Default is 1000 (i.e.,
retry for 1 second).
</p>
</dd>
<dt class="hdlist1">
core.pager
</dt>
<dd>
<p>
Text viewer for use by Git commands (e.g., <em>less</em>). The value
is meant to be interpreted by the shell. The order of preference
is the <code>$GIT_PAGER</code> environment variable, then <code>core.pager</code>
configuration, then <code>$PAGER</code>, and then the default chosen at
compile time (usually <em>less</em>).
</p>
<div class="paragraph"><p>When the <code>LESS</code> environment variable is unset, Git sets it to <code>FRX</code>
(if <code>LESS</code> environment variable is set, Git does not change it at
all). If you want to selectively override Git&#8217;s default setting
for <code>LESS</code>, you can set <code>core.pager</code> to e.g. <code>less -S</code>. This will
be passed to the shell by Git, which will translate the final
command to <code>LESS=FRX less -S</code>. The environment does not set the
<code>S</code> option but the command line does, instructing less to truncate
long lines. Similarly, setting <code>core.pager</code> to <code>less -+F</code> will
deactivate the <code>F</code> option specified by the environment from the
command-line, deactivating the "quit if one screen" behavior of
<code>less</code>. One can specifically activate some flags for particular
commands: for example, setting <code>pager.blame</code> to <code>less -S</code> enables
line truncation only for <code>git blame</code>.</p></div>
<div class="paragraph"><p>Likewise, when the <code>LV</code> environment variable is unset, Git sets it
to <code>-c</code>. You can override this setting by exporting <code>LV</code> with
another value or setting <code>core.pager</code> to <code>lv +c</code>.</p></div>
</dd>
<dt class="hdlist1">
core.whitespace
</dt>
<dd>
<p>
A comma separated list of common whitespace problems to
notice. <em>git diff</em> will use <code>color.diff.whitespace</code> to
highlight them, and <em>git apply --whitespace=error</em> will
consider them as errors. You can prefix <code>-</code> to disable
any of them (e.g. <code>-trailing-space</code>):
</p>
<div class="ulist"><ul>
<li>
<p>
<code>blank-at-eol</code> treats trailing whitespaces at the end of the line
as an error (enabled by default).
</p>
</li>
<li>
<p>
<code>space-before-tab</code> treats a space character that appears immediately
before a tab character in the initial indent part of the line as an
error (enabled by default).
</p>
</li>
<li>
<p>
<code>indent-with-non-tab</code> treats a line that is indented with space
characters instead of the equivalent tabs as an error (not enabled by
default).
</p>
</li>
<li>
<p>
<code>tab-in-indent</code> treats a tab character in the initial indent part of
the line as an error (not enabled by default).
</p>
</li>
<li>
<p>
<code>blank-at-eof</code> treats blank lines added at the end of file as an error
(enabled by default).
</p>
</li>
<li>
<p>
<code>trailing-space</code> is a short-hand to cover both <code>blank-at-eol</code> and
<code>blank-at-eof</code>.
</p>
</li>
<li>
<p>
<code>cr-at-eol</code> treats a carriage-return at the end of line as
part of the line terminator, i.e. with it, <code>trailing-space</code>
does not trigger if the character before such a carriage-return
is not a whitespace (not enabled by default).
</p>
</li>
<li>
<p>
<code>tabwidth=&lt;n&gt;</code> tells how many character positions a tab occupies; this
is relevant for <code>indent-with-non-tab</code> and when Git fixes <code>tab-in-indent</code>
errors. The default tab width is 8. Allowed values are 1 to 63.
</p>
</li>
</ul></div>
</dd>
<dt class="hdlist1">
core.fsyncObjectFiles
</dt>
<dd>
<p>
This boolean will enable <em>fsync()</em> when writing object files.
</p>
<div class="paragraph"><p>This is a total waste of time and effort on a filesystem that orders
data writes properly, but can be useful for filesystems that do not use
journalling (traditional UNIX filesystems) or that only journal metadata
and not file contents (OS X&#8217;s HFS+, or Linux ext3 with "data=writeback").</p></div>
</dd>
<dt class="hdlist1">
core.preloadIndex
</dt>
<dd>
<p>
Enable parallel index preload for operations like <em>git diff</em>
</p>
<div class="paragraph"><p>This can speed up operations like <em>git diff</em> and <em>git status</em> 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&#8217;s. Defaults to true.</p></div>
</dd>
<dt class="hdlist1">
core.unsetenvvars
</dt>
<dd>
<p>
Windows-only: comma-separated list of environment variables'
names that need to be unset before spawning any other process.
Defaults to <code>PERL5LIB</code> to account for the fact that Git for
Windows insists on using its own Perl interpreter.
</p>
</dd>
<dt class="hdlist1">
core.createObject
</dt>
<dd>
<p>
You can set this to <em>link</em>, 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.
</p>
<div class="paragraph"><p>On some file system/operating system combinations, this is unreliable.
Set this config setting to <em>rename</em> there; However, This will remove the
check that makes sure that existing object files will not get overwritten.</p></div>
</dd>
<dt class="hdlist1">
core.notesRef
</dt>
<dd>
<p>
When showing commit messages, also show notes which are stored in
the given ref. The ref must be fully qualified. If the given
ref does not exist, it is not an error but means that no
notes should be printed.
</p>