esy-bash
Version:
Cross-platform bash utilities - primed for Reason/OCaml
1,631 lines (1,548 loc) • 270 kB
HTML
<!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.9" />
<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">
/*<+'])');
// 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> [<file-option>] [type] [--show-origin] [-z|--null] name [value [value_regex]]
<em>git config</em> [<file-option>] [type] --add name value
<em>git config</em> [<file-option>] [type] --replace-all name value [value_regex]
<em>git config</em> [<file-option>] [type] [--show-origin] [-z|--null] --get name [value_regex]
<em>git config</em> [<file-option>] [type] [--show-origin] [-z|--null] --get-all name [value_regex]
<em>git config</em> [<file-option>] [type] [--show-origin] [-z|--null] [--name-only] --get-regexp name_regex [value_regex]
<em>git config</em> [<file-option>] [type] [-z|--null] --get-urlmatch name URL
<em>git config</em> [<file-option>] --unset name [value_regex]
<em>git config</em> [<file-option>] --unset-all name [value_regex]
<em>git config</em> [<file-option>] --rename-section old_name new_name
<em>git config</em> [<file-option>] --remove-section name
<em>git config</em> [<file-option>] [--show-origin] [-z|--null] [--name-only] -l | --list
<em>git config</em> [<file-option>] --get-color name [default]
<em>git config</em> [<file-option>] --get-colorbool name [stdout-is-tty]
<em>git config</em> [<file-option>] -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 type specifier can be either <code>--int</code> or <code>--bool</code>, to make
<em>git config</em> ensure that the variable(s) are of the given type and
convert the value to the canonical form (simple decimal number for int,
a "true" or "false" string for bool), or <code>--path</code>, which does some
path expansion (see <code>--path</code> below). If no type specifier is passed, no
checks or transformations are performed on the value.</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> and <code>--file <filename></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>--file <filename></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.<url>.key whose <url> 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’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">
-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">
--bool
</dt>
<dd>
<p>
<em>git config</em> will ensure that the output is "true" or "false"
</p>
</dd>
<dt class="hdlist1">
--int
</dt>
<dd>
<p>
<em>git config</em> will ensure that the output is a simple
decimal number. An optional value suffix of <em>k</em>, <em>m</em>, or <em>g</em>
in the config file will cause the value to be multiplied
by 1024, 1048576, or 1073741824 prior to output.
</p>
</dd>
<dt class="hdlist1">
--bool-or-int
</dt>
<dd>
<p>
<em>git config</em> will ensure that the output matches the format of
either --bool or --int, as described above.
</p>
</dd>
<dt class="hdlist1">
--path
</dt>
<dd>
<p>
<code>git config</code> will expand a leading <code>~</code> to the value of
<code>$HOME</code>, and <code>~user</code> to the home directory for the
specified user. This option 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>
</dd>
<dt class="hdlist1">
--expiry-date
</dt>
<dd>
<p>
<code>git config</code> will ensure that the output is converted from
a fixed or relative date-string to a timestamp. This option
has no effect when setting the value.
</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>
</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>
</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>
</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> and the <code>--system</code> options will limit the file used
to the global or system-wide 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 …" 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 --bool --get-urlmatch http.sslverify https://good.example.com
true
% git config --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 <code>.git/config</code> file in each repository
is 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’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.<condition>.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 & 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>
<