"Fossies" - the Fresh Open Source Software Archive

Member "git-update-index.html" (15 Dec 2018, 46230 Bytes) of package /linux/misc/git-htmldocs-2.20.1.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <?xml version="1.0" encoding="UTF-8"?>
    2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    3     "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    5 <head>
    6 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
    7 <meta name="generator" content="AsciiDoc 8.6.10" />
    8 <title>git-update-index(1)</title>
    9 <style type="text/css">
   10 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
   11 
   12 /* Default font. */
   13 body {
   14   font-family: Georgia,serif;
   15 }
   16 
   17 /* Title font. */
   18 h1, h2, h3, h4, h5, h6,
   19 div.title, caption.title,
   20 thead, p.table.header,
   21 #toctitle,
   22 #author, #revnumber, #revdate, #revremark,
   23 #footer {
   24   font-family: Arial,Helvetica,sans-serif;
   25 }
   26 
   27 body {
   28   margin: 1em 5% 1em 5%;
   29 }
   30 
   31 a {
   32   color: blue;
   33   text-decoration: underline;
   34 }
   35 a:visited {
   36   color: fuchsia;
   37 }
   38 
   39 em {
   40   font-style: italic;
   41   color: navy;
   42 }
   43 
   44 strong {
   45   font-weight: bold;
   46   color: #083194;
   47 }
   48 
   49 h1, h2, h3, h4, h5, h6 {
   50   color: #527bbd;
   51   margin-top: 1.2em;
   52   margin-bottom: 0.5em;
   53   line-height: 1.3;
   54 }
   55 
   56 h1, h2, h3 {
   57   border-bottom: 2px solid silver;
   58 }
   59 h2 {
   60   padding-top: 0.5em;
   61 }
   62 h3 {
   63   float: left;
   64 }
   65 h3 + * {
   66   clear: left;
   67 }
   68 h5 {
   69   font-size: 1.0em;
   70 }
   71 
   72 div.sectionbody {
   73   margin-left: 0;
   74 }
   75 
   76 hr {
   77   border: 1px solid silver;
   78 }
   79 
   80 p {
   81   margin-top: 0.5em;
   82   margin-bottom: 0.5em;
   83 }
   84 
   85 ul, ol, li > p {
   86   margin-top: 0;
   87 }
   88 ul > li     { color: #aaa; }
   89 ul > li > * { color: black; }
   90 
   91 .monospaced, code, pre {
   92   font-family: "Courier New", Courier, monospace;
   93   font-size: inherit;
   94   color: navy;
   95   padding: 0;
   96   margin: 0;
   97 }
   98 pre {
   99   white-space: pre-wrap;
  100 }
  101 
  102 #author {
  103   color: #527bbd;
  104   font-weight: bold;
  105   font-size: 1.1em;
  106 }
  107 #email {
  108 }
  109 #revnumber, #revdate, #revremark {
  110 }
  111 
  112 #footer {
  113   font-size: small;
  114   border-top: 2px solid silver;
  115   padding-top: 0.5em;
  116   margin-top: 4.0em;
  117 }
  118 #footer-text {
  119   float: left;
  120   padding-bottom: 0.5em;
  121 }
  122 #footer-badges {
  123   float: right;
  124   padding-bottom: 0.5em;
  125 }
  126 
  127 #preamble {
  128   margin-top: 1.5em;
  129   margin-bottom: 1.5em;
  130 }
  131 div.imageblock, div.exampleblock, div.verseblock,
  132 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
  133 div.admonitionblock {
  134   margin-top: 1.0em;
  135   margin-bottom: 1.5em;
  136 }
  137 div.admonitionblock {
  138   margin-top: 2.0em;
  139   margin-bottom: 2.0em;
  140   margin-right: 10%;
  141   color: #606060;
  142 }
  143 
  144 div.content { /* Block element content. */
  145   padding: 0;
  146 }
  147 
  148 /* Block element titles. */
  149 div.title, caption.title {
  150   color: #527bbd;
  151   font-weight: bold;
  152   text-align: left;
  153   margin-top: 1.0em;
  154   margin-bottom: 0.5em;
  155 }
  156 div.title + * {
  157   margin-top: 0;
  158 }
  159 
  160 td div.title:first-child {
  161   margin-top: 0.0em;
  162 }
  163 div.content div.title:first-child {
  164   margin-top: 0.0em;
  165 }
  166 div.content + div.title {
  167   margin-top: 0.0em;
  168 }
  169 
  170 div.sidebarblock > div.content {
  171   background: #ffffee;
  172   border: 1px solid #dddddd;
  173   border-left: 4px solid #f0f0f0;
  174   padding: 0.5em;
  175 }
  176 
  177 div.listingblock > div.content {
  178   border: 1px solid #dddddd;
  179   border-left: 5px solid #f0f0f0;
  180   background: #f8f8f8;
  181   padding: 0.5em;
  182 }
  183 
  184 div.quoteblock, div.verseblock {
  185   padding-left: 1.0em;
  186   margin-left: 1.0em;
  187   margin-right: 10%;
  188   border-left: 5px solid #f0f0f0;
  189   color: #888;
  190 }
  191 
  192 div.quoteblock > div.attribution {
  193   padding-top: 0.5em;
  194   text-align: right;
  195 }
  196 
  197 div.verseblock > pre.content {
  198   font-family: inherit;
  199   font-size: inherit;
  200 }
  201 div.verseblock > div.attribution {
  202   padding-top: 0.75em;
  203   text-align: left;
  204 }
  205 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
  206 div.verseblock + div.attribution {
  207   text-align: left;
  208 }
  209 
  210 div.admonitionblock .icon {
  211   vertical-align: top;
  212   font-size: 1.1em;
  213   font-weight: bold;
  214   text-decoration: underline;
  215   color: #527bbd;
  216   padding-right: 0.5em;
  217 }
  218 div.admonitionblock td.content {
  219   padding-left: 0.5em;
  220   border-left: 3px solid #dddddd;
  221 }
  222 
  223 div.exampleblock > div.content {
  224   border-left: 3px solid #dddddd;
  225   padding-left: 0.5em;
  226 }
  227 
  228 div.imageblock div.content { padding-left: 0; }
  229 span.image img { border-style: none; vertical-align: text-bottom; }
  230 a.image:visited { color: white; }
  231 
  232 dl {
  233   margin-top: 0.8em;
  234   margin-bottom: 0.8em;
  235 }
  236 dt {
  237   margin-top: 0.5em;
  238   margin-bottom: 0;
  239   font-style: normal;
  240   color: navy;
  241 }
  242 dd > *:first-child {
  243   margin-top: 0.1em;
  244 }
  245 
  246 ul, ol {
  247     list-style-position: outside;
  248 }
  249 ol.arabic {
  250   list-style-type: decimal;
  251 }
  252 ol.loweralpha {
  253   list-style-type: lower-alpha;
  254 }
  255 ol.upperalpha {
  256   list-style-type: upper-alpha;
  257 }
  258 ol.lowerroman {
  259   list-style-type: lower-roman;
  260 }
  261 ol.upperroman {
  262   list-style-type: upper-roman;
  263 }
  264 
  265 div.compact ul, div.compact ol,
  266 div.compact p, div.compact p,
  267 div.compact div, div.compact div {
  268   margin-top: 0.1em;
  269   margin-bottom: 0.1em;
  270 }
  271 
  272 tfoot {
  273   font-weight: bold;
  274 }
  275 td > div.verse {
  276   white-space: pre;
  277 }
  278 
  279 div.hdlist {
  280   margin-top: 0.8em;
  281   margin-bottom: 0.8em;
  282 }
  283 div.hdlist tr {
  284   padding-bottom: 15px;
  285 }
  286 dt.hdlist1.strong, td.hdlist1.strong {
  287   font-weight: bold;
  288 }
  289 td.hdlist1 {
  290   vertical-align: top;
  291   font-style: normal;
  292   padding-right: 0.8em;
  293   color: navy;
  294 }
  295 td.hdlist2 {
  296   vertical-align: top;
  297 }
  298 div.hdlist.compact tr {
  299   margin: 0;
  300   padding-bottom: 0;
  301 }
  302 
  303 .comment {
  304   background: yellow;
  305 }
  306 
  307 .footnote, .footnoteref {
  308   font-size: 0.8em;
  309 }
  310 
  311 span.footnote, span.footnoteref {
  312   vertical-align: super;
  313 }
  314 
  315 #footnotes {
  316   margin: 20px 0 20px 0;
  317   padding: 7px 0 0 0;
  318 }
  319 
  320 #footnotes div.footnote {
  321   margin: 0 0 5px 0;
  322 }
  323 
  324 #footnotes hr {
  325   border: none;
  326   border-top: 1px solid silver;
  327   height: 1px;
  328   text-align: left;
  329   margin-left: 0;
  330   width: 20%;
  331   min-width: 100px;
  332 }
  333 
  334 div.colist td {
  335   padding-right: 0.5em;
  336   padding-bottom: 0.3em;
  337   vertical-align: top;
  338 }
  339 div.colist td img {
  340   margin-top: 0.3em;
  341 }
  342 
  343 @media print {
  344   #footer-badges { display: none; }
  345 }
  346 
  347 #toc {
  348   margin-bottom: 2.5em;
  349 }
  350 
  351 #toctitle {
  352   color: #527bbd;
  353   font-size: 1.1em;
  354   font-weight: bold;
  355   margin-top: 1.0em;
  356   margin-bottom: 0.1em;
  357 }
  358 
  359 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
  360   margin-top: 0;
  361   margin-bottom: 0;
  362 }
  363 div.toclevel2 {
  364   margin-left: 2em;
  365   font-size: 0.9em;
  366 }
  367 div.toclevel3 {
  368   margin-left: 4em;
  369   font-size: 0.9em;
  370 }
  371 div.toclevel4 {
  372   margin-left: 6em;
  373   font-size: 0.9em;
  374 }
  375 
  376 span.aqua { color: aqua; }
  377 span.black { color: black; }
  378 span.blue { color: blue; }
  379 span.fuchsia { color: fuchsia; }
  380 span.gray { color: gray; }
  381 span.green { color: green; }
  382 span.lime { color: lime; }
  383 span.maroon { color: maroon; }
  384 span.navy { color: navy; }
  385 span.olive { color: olive; }
  386 span.purple { color: purple; }
  387 span.red { color: red; }
  388 span.silver { color: silver; }
  389 span.teal { color: teal; }
  390 span.white { color: white; }
  391 span.yellow { color: yellow; }
  392 
  393 span.aqua-background { background: aqua; }
  394 span.black-background { background: black; }
  395 span.blue-background { background: blue; }
  396 span.fuchsia-background { background: fuchsia; }
  397 span.gray-background { background: gray; }
  398 span.green-background { background: green; }
  399 span.lime-background { background: lime; }
  400 span.maroon-background { background: maroon; }
  401 span.navy-background { background: navy; }
  402 span.olive-background { background: olive; }
  403 span.purple-background { background: purple; }
  404 span.red-background { background: red; }
  405 span.silver-background { background: silver; }
  406 span.teal-background { background: teal; }
  407 span.white-background { background: white; }
  408 span.yellow-background { background: yellow; }
  409 
  410 span.big { font-size: 2em; }
  411 span.small { font-size: 0.6em; }
  412 
  413 span.underline { text-decoration: underline; }
  414 span.overline { text-decoration: overline; }
  415 span.line-through { text-decoration: line-through; }
  416 
  417 div.unbreakable { page-break-inside: avoid; }
  418 
  419 
  420 /*
  421  * xhtml11 specific
  422  *
  423  * */
  424 
  425 div.tableblock {
  426   margin-top: 1.0em;
  427   margin-bottom: 1.5em;
  428 }
  429 div.tableblock > table {
  430   border: 3px solid #527bbd;
  431 }
  432 thead, p.table.header {
  433   font-weight: bold;
  434   color: #527bbd;
  435 }
  436 p.table {
  437   margin-top: 0;
  438 }
  439 /* Because the table frame attribute is overriden by CSS in most browsers. */
  440 div.tableblock > table[frame="void"] {
  441   border-style: none;
  442 }
  443 div.tableblock > table[frame="hsides"] {
  444   border-left-style: none;
  445   border-right-style: none;
  446 }
  447 div.tableblock > table[frame="vsides"] {
  448   border-top-style: none;
  449   border-bottom-style: none;
  450 }
  451 
  452 
  453 /*
  454  * html5 specific
  455  *
  456  * */
  457 
  458 table.tableblock {
  459   margin-top: 1.0em;
  460   margin-bottom: 1.5em;
  461 }
  462 thead, p.tableblock.header {
  463   font-weight: bold;
  464   color: #527bbd;
  465 }
  466 p.tableblock {
  467   margin-top: 0;
  468 }
  469 table.tableblock {
  470   border-width: 3px;
  471   border-spacing: 0px;
  472   border-style: solid;
  473   border-color: #527bbd;
  474   border-collapse: collapse;
  475 }
  476 th.tableblock, td.tableblock {
  477   border-width: 1px;
  478   padding: 4px;
  479   border-style: solid;
  480   border-color: #527bbd;
  481 }
  482 
  483 table.tableblock.frame-topbot {
  484   border-left-style: hidden;
  485   border-right-style: hidden;
  486 }
  487 table.tableblock.frame-sides {
  488   border-top-style: hidden;
  489   border-bottom-style: hidden;
  490 }
  491 table.tableblock.frame-none {
  492   border-style: hidden;
  493 }
  494 
  495 th.tableblock.halign-left, td.tableblock.halign-left {
  496   text-align: left;
  497 }
  498 th.tableblock.halign-center, td.tableblock.halign-center {
  499   text-align: center;
  500 }
  501 th.tableblock.halign-right, td.tableblock.halign-right {
  502   text-align: right;
  503 }
  504 
  505 th.tableblock.valign-top, td.tableblock.valign-top {
  506   vertical-align: top;
  507 }
  508 th.tableblock.valign-middle, td.tableblock.valign-middle {
  509   vertical-align: middle;
  510 }
  511 th.tableblock.valign-bottom, td.tableblock.valign-bottom {
  512   vertical-align: bottom;
  513 }
  514 
  515 
  516 /*
  517  * manpage specific
  518  *
  519  * */
  520 
  521 body.manpage h1 {
  522   padding-top: 0.5em;
  523   padding-bottom: 0.5em;
  524   border-top: 2px solid silver;
  525   border-bottom: 2px solid silver;
  526 }
  527 body.manpage h2 {
  528   border-style: none;
  529 }
  530 body.manpage div.sectionbody {
  531   margin-left: 3em;
  532 }
  533 
  534 @media print {
  535   body.manpage div#toc { display: none; }
  536 }
  537 
  538 
  539 </style>
  540 <script type="text/javascript">
  541 /*<![CDATA[*/
  542 var asciidoc = {  // Namespace.
  543 
  544 /////////////////////////////////////////////////////////////////////
  545 // Table Of Contents generator
  546 /////////////////////////////////////////////////////////////////////
  547 
  548 /* Author: Mihai Bazon, September 2002
  549  * http://students.infoiasi.ro/~mishoo
  550  *
  551  * Table Of Content generator
  552  * Version: 0.4
  553  *
  554  * Feel free to use this script under the terms of the GNU General Public
  555  * License, as long as you do not remove or alter this notice.
  556  */
  557 
  558  /* modified by Troy D. Hanson, September 2006. License: GPL */
  559  /* modified by Stuart Rackham, 2006, 2009. License: GPL */
  560 
  561 // toclevels = 1..4.
  562 toc: function (toclevels) {
  563 
  564   function getText(el) {
  565     var text = "";
  566     for (var i = el.firstChild; i != null; i = i.nextSibling) {
  567       if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
  568         text += i.data;
  569       else if (i.firstChild != null)
  570         text += getText(i);
  571     }
  572     return text;
  573   }
  574 
  575   function TocEntry(el, text, toclevel) {
  576     this.element = el;
  577     this.text = text;
  578     this.toclevel = toclevel;
  579   }
  580 
  581   function tocEntries(el, toclevels) {
  582     var result = new Array;
  583     var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
  584     // Function that scans the DOM tree for header elements (the DOM2
  585     // nodeIterator API would be a better technique but not supported by all
  586     // browsers).
  587     var iterate = function (el) {
  588       for (var i = el.firstChild; i != null; i = i.nextSibling) {
  589         if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
  590           var mo = re.exec(i.tagName);
  591           if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
  592             result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
  593           }
  594           iterate(i);
  595         }
  596       }
  597     }
  598     iterate(el);
  599     return result;
  600   }
  601 
  602   var toc = document.getElementById("toc");
  603   if (!toc) {
  604     return;
  605   }
  606 
  607   // Delete existing TOC entries in case we're reloading the TOC.
  608   var tocEntriesToRemove = [];
  609   var i;
  610   for (i = 0; i < toc.childNodes.length; i++) {
  611     var entry = toc.childNodes[i];
  612     if (entry.nodeName.toLowerCase() == 'div'
  613      && entry.getAttribute("class")
  614      && entry.getAttribute("class").match(/^toclevel/))
  615       tocEntriesToRemove.push(entry);
  616   }
  617   for (i = 0; i < tocEntriesToRemove.length; i++) {
  618     toc.removeChild(tocEntriesToRemove[i]);
  619   }
  620 
  621   // Rebuild TOC entries.
  622   var entries = tocEntries(document.getElementById("content"), toclevels);
  623   for (var i = 0; i < entries.length; ++i) {
  624     var entry = entries[i];
  625     if (entry.element.id == "")
  626       entry.element.id = "_toc_" + i;
  627     var a = document.createElement("a");
  628     a.href = "#" + entry.element.id;
  629     a.appendChild(document.createTextNode(entry.text));
  630     var div = document.createElement("div");
  631     div.appendChild(a);
  632     div.className = "toclevel" + entry.toclevel;
  633     toc.appendChild(div);
  634   }
  635   if (entries.length == 0)
  636     toc.parentNode.removeChild(toc);
  637 },
  638 
  639 
  640 /////////////////////////////////////////////////////////////////////
  641 // Footnotes generator
  642 /////////////////////////////////////////////////////////////////////
  643 
  644 /* Based on footnote generation code from:
  645  * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
  646  */
  647 
  648 footnotes: function () {
  649   // Delete existing footnote entries in case we're reloading the footnodes.
  650   var i;
  651   var noteholder = document.getElementById("footnotes");
  652   if (!noteholder) {
  653     return;
  654   }
  655   var entriesToRemove = [];
  656   for (i = 0; i < noteholder.childNodes.length; i++) {
  657     var entry = noteholder.childNodes[i];
  658     if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
  659       entriesToRemove.push(entry);
  660   }
  661   for (i = 0; i < entriesToRemove.length; i++) {
  662     noteholder.removeChild(entriesToRemove[i]);
  663   }
  664 
  665   // Rebuild footnote entries.
  666   var cont = document.getElementById("content");
  667   var spans = cont.getElementsByTagName("span");
  668   var refs = {};
  669   var n = 0;
  670   for (i=0; i<spans.length; i++) {
  671     if (spans[i].className == "footnote") {
  672       n++;
  673       var note = spans[i].getAttribute("data-note");
  674       if (!note) {
  675         // Use [\s\S] in place of . so multi-line matches work.
  676         // Because JavaScript has no s (dotall) regex flag.
  677         note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
  678         spans[i].innerHTML =
  679           "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
  680           "' title='View footnote' class='footnote'>" + n + "</a>]";
  681         spans[i].setAttribute("data-note", note);
  682       }
  683       noteholder.innerHTML +=
  684         "<div class='footnote' id='_footnote_" + n + "'>" +
  685         "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
  686         n + "</a>. " + note + "</div>";
  687       var id =spans[i].getAttribute("id");
  688       if (id != null) refs["#"+id] = n;
  689     }
  690   }
  691   if (n == 0)
  692     noteholder.parentNode.removeChild(noteholder);
  693   else {
  694     // Process footnoterefs.
  695     for (i=0; i<spans.length; i++) {
  696       if (spans[i].className == "footnoteref") {
  697         var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
  698         href = href.match(/#.*/)[0];  // Because IE return full URL.
  699         n = refs[href];
  700         spans[i].innerHTML =
  701           "[<a href='#_footnote_" + n +
  702           "' title='View footnote' class='footnote'>" + n + "</a>]";
  703       }
  704     }
  705   }
  706 },
  707 
  708 install: function(toclevels) {
  709   var timerId;
  710 
  711   function reinstall() {
  712     asciidoc.footnotes();
  713     if (toclevels) {
  714       asciidoc.toc(toclevels);
  715     }
  716   }
  717 
  718   function reinstallAndRemoveTimer() {
  719     clearInterval(timerId);
  720     reinstall();
  721   }
  722 
  723   timerId = setInterval(reinstall, 500);
  724   if (document.addEventListener)
  725     document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
  726   else
  727     window.onload = reinstallAndRemoveTimer;
  728 }
  729 
  730 }
  731 asciidoc.install();
  732 /*]]>*/
  733 </script>
  734 </head>
  735 <body class="manpage">
  736 <div id="header">
  737 <h1>
  738 git-update-index(1) Manual Page
  739 </h1>
  740 <h2>NAME</h2>
  741 <div class="sectionbody">
  742 <p>git-update-index -
  743    Register file contents in the working tree to the index
  744 </p>
  745 </div>
  746 </div>
  747 <div id="content">
  748 <div class="sect1">
  749 <h2 id="_synopsis">SYNOPSIS</h2>
  750 <div class="sectionbody">
  751 <div class="verseblock">
  752 <pre class="content"><em>git update-index</em>
  753              [--add] [--remove | --force-remove] [--replace]
  754              [--refresh] [-q] [--unmerged] [--ignore-missing]
  755              [(--cacheinfo &lt;mode&gt;,&lt;object&gt;,&lt;file&gt;)&#8230;]
  756              [--chmod=(+|-)x]
  757              [--[no-]assume-unchanged]
  758              [--[no-]skip-worktree]
  759              [--[no-]fsmonitor-valid]
  760              [--ignore-submodules]
  761              [--[no-]split-index]
  762              [--[no-|test-|force-]untracked-cache]
  763              [--[no-]fsmonitor]
  764              [--really-refresh] [--unresolve] [--again | -g]
  765              [--info-only] [--index-info]
  766              [-z] [--stdin] [--index-version &lt;n&gt;]
  767              [--verbose]
  768              [--] [&lt;file&gt;&#8230;]</pre>
  769 <div class="attribution">
  770 </div></div>
  771 </div>
  772 </div>
  773 <div class="sect1">
  774 <h2 id="_description">DESCRIPTION</h2>
  775 <div class="sectionbody">
  776 <div class="paragraph"><p>Modifies the index or directory cache. Each file mentioned is updated
  777 into the index and any <em>unmerged</em> or <em>needs updating</em> state is
  778 cleared.</p></div>
  779 <div class="paragraph"><p>See also <a href="git-add.html">git-add(1)</a> for a more user-friendly way to do some of
  780 the most common operations on the index.</p></div>
  781 <div class="paragraph"><p>The way <em>git update-index</em> handles files it is told about can be modified
  782 using the various options:</p></div>
  783 </div>
  784 </div>
  785 <div class="sect1">
  786 <h2 id="_options">OPTIONS</h2>
  787 <div class="sectionbody">
  788 <div class="dlist"><dl>
  789 <dt class="hdlist1">
  790 --add
  791 </dt>
  792 <dd>
  793 <p>
  794         If a specified file isn&#8217;t in the index already then it&#8217;s
  795         added.
  796         Default behaviour is to ignore new files.
  797 </p>
  798 </dd>
  799 <dt class="hdlist1">
  800 --remove
  801 </dt>
  802 <dd>
  803 <p>
  804         If a specified file is in the index but is missing then it&#8217;s
  805         removed.
  806         Default behavior is to ignore removed file.
  807 </p>
  808 </dd>
  809 <dt class="hdlist1">
  810 --refresh
  811 </dt>
  812 <dd>
  813 <p>
  814         Looks at the current index and checks to see if merges or
  815         updates are needed by checking stat() information.
  816 </p>
  817 </dd>
  818 <dt class="hdlist1">
  819 -q
  820 </dt>
  821 <dd>
  822 <p>
  823         Quiet.  If --refresh finds that the index needs an update, the
  824         default behavior is to error out.  This option makes
  825         <em>git update-index</em> continue anyway.
  826 </p>
  827 </dd>
  828 <dt class="hdlist1">
  829 --ignore-submodules
  830 </dt>
  831 <dd>
  832 <p>
  833         Do not try to update submodules.  This option is only respected
  834         when passed before --refresh.
  835 </p>
  836 </dd>
  837 <dt class="hdlist1">
  838 --unmerged
  839 </dt>
  840 <dd>
  841 <p>
  842         If --refresh finds unmerged changes in the index, the default
  843         behavior is to error out.  This option makes <em>git update-index</em>
  844         continue anyway.
  845 </p>
  846 </dd>
  847 <dt class="hdlist1">
  848 --ignore-missing
  849 </dt>
  850 <dd>
  851 <p>
  852         Ignores missing files during a --refresh
  853 </p>
  854 </dd>
  855 <dt class="hdlist1">
  856 --cacheinfo &lt;mode&gt;,&lt;object&gt;,&lt;path&gt;
  857 </dt>
  858 <dt class="hdlist1">
  859 --cacheinfo &lt;mode&gt; &lt;object&gt; &lt;path&gt;
  860 </dt>
  861 <dd>
  862 <p>
  863         Directly insert the specified info into the index.  For
  864         backward compatibility, you can also give these three
  865         arguments as three separate parameters, but new users are
  866         encouraged to use a single-parameter form.
  867 </p>
  868 </dd>
  869 <dt class="hdlist1">
  870 --index-info
  871 </dt>
  872 <dd>
  873 <p>
  874         Read index information from stdin.
  875 </p>
  876 </dd>
  877 <dt class="hdlist1">
  878 --chmod=(+|-)x
  879 </dt>
  880 <dd>
  881 <p>
  882         Set the execute permissions on the updated files.
  883 </p>
  884 </dd>
  885 <dt class="hdlist1">
  886 --[no-]assume-unchanged
  887 </dt>
  888 <dd>
  889 <p>
  890         When this flag is specified, the object names recorded
  891         for the paths are not updated.  Instead, this option
  892         sets/unsets the "assume unchanged" bit for the
  893         paths.  When the "assume unchanged" bit is on, the user
  894         promises not to change the file and allows Git to assume
  895         that the working tree file matches what is recorded in
  896         the index.  If you want to change the working tree file,
  897         you need to unset the bit to tell Git.  This is
  898         sometimes helpful when working with a big project on a
  899         filesystem that has very slow lstat(2) system call
  900         (e.g. cifs).
  901 </p>
  902 <div class="paragraph"><p>Git will fail (gracefully) in case it needs to modify this file
  903 in the index e.g. when merging in a commit;
  904 thus, in case the assumed-untracked file is changed upstream,
  905 you will need to handle the situation manually.</p></div>
  906 </dd>
  907 <dt class="hdlist1">
  908 --really-refresh
  909 </dt>
  910 <dd>
  911 <p>
  912         Like <code>--refresh</code>, but checks stat information unconditionally,
  913         without regard to the "assume unchanged" setting.
  914 </p>
  915 </dd>
  916 <dt class="hdlist1">
  917 --[no-]skip-worktree
  918 </dt>
  919 <dd>
  920 <p>
  921         When one of these flags is specified, the object name recorded
  922         for the paths are not updated. Instead, these options
  923         set and unset the "skip-worktree" bit for the paths. See
  924         section "Skip-worktree bit" below for more information.
  925 </p>
  926 </dd>
  927 <dt class="hdlist1">
  928 --[no-]fsmonitor-valid
  929 </dt>
  930 <dd>
  931 <p>
  932         When one of these flags is specified, the object name recorded
  933         for the paths are not updated. Instead, these options
  934         set and unset the "fsmonitor valid" bit for the paths. See
  935         section "File System Monitor" below for more information.
  936 </p>
  937 </dd>
  938 <dt class="hdlist1">
  939 -g
  940 </dt>
  941 <dt class="hdlist1">
  942 --again
  943 </dt>
  944 <dd>
  945 <p>
  946         Runs <em>git update-index</em> itself on the paths whose index
  947         entries are different from those from the <code>HEAD</code> commit.
  948 </p>
  949 </dd>
  950 <dt class="hdlist1">
  951 --unresolve
  952 </dt>
  953 <dd>
  954 <p>
  955         Restores the <em>unmerged</em> or <em>needs updating</em> state of a
  956         file during a merge if it was cleared by accident.
  957 </p>
  958 </dd>
  959 <dt class="hdlist1">
  960 --info-only
  961 </dt>
  962 <dd>
  963 <p>
  964         Do not create objects in the object database for all
  965         &lt;file&gt; arguments that follow this flag; just insert
  966         their object IDs into the index.
  967 </p>
  968 </dd>
  969 <dt class="hdlist1">
  970 --force-remove
  971 </dt>
  972 <dd>
  973 <p>
  974         Remove the file from the index even when the working directory
  975         still has such a file. (Implies --remove.)
  976 </p>
  977 </dd>
  978 <dt class="hdlist1">
  979 --replace
  980 </dt>
  981 <dd>
  982 <p>
  983         By default, when a file <code>path</code> exists in the index,
  984         <em>git update-index</em> refuses an attempt to add <code>path/file</code>.
  985         Similarly if a file <code>path/file</code> exists, a file <code>path</code>
  986         cannot be added.  With --replace flag, existing entries
  987         that conflict with the entry being added are
  988         automatically removed with warning messages.
  989 </p>
  990 </dd>
  991 <dt class="hdlist1">
  992 --stdin
  993 </dt>
  994 <dd>
  995 <p>
  996         Instead of taking list of paths from the command line,
  997         read list of paths from the standard input.  Paths are
  998         separated by LF (i.e. one path per line) by default.
  999 </p>
 1000 </dd>
 1001 <dt class="hdlist1">
 1002 --verbose
 1003 </dt>
 1004 <dd>
 1005 <p>
 1006         Report what is being added and removed from index.
 1007 </p>
 1008 </dd>
 1009 <dt class="hdlist1">
 1010 --index-version &lt;n&gt;
 1011 </dt>
 1012 <dd>
 1013 <p>
 1014         Write the resulting index out in the named on-disk format version.
 1015         Supported versions are 2, 3 and 4. The current default version is 2
 1016         or 3, depending on whether extra features are used, such as
 1017         <code>git add -N</code>.
 1018 </p>
 1019 <div class="paragraph"><p>Version 4 performs a simple pathname compression that reduces index
 1020 size by 30%-50% on large repositories, which results in faster load
 1021 time. Version 4 is relatively young (first released in 1.8.0 in
 1022 October 2012). Other Git implementations such as JGit and libgit2
 1023 may not support it yet.</p></div>
 1024 </dd>
 1025 <dt class="hdlist1">
 1026 -z
 1027 </dt>
 1028 <dd>
 1029 <p>
 1030         Only meaningful with <code>--stdin</code> or <code>--index-info</code>; paths are
 1031         separated with NUL character instead of LF.
 1032 </p>
 1033 </dd>
 1034 <dt class="hdlist1">
 1035 --split-index
 1036 </dt>
 1037 <dt class="hdlist1">
 1038 --no-split-index
 1039 </dt>
 1040 <dd>
 1041 <p>
 1042         Enable or disable split index mode. If split-index mode is
 1043         already enabled and <code>--split-index</code> is given again, all
 1044         changes in $GIT_DIR/index are pushed back to the shared index
 1045         file.
 1046 </p>
 1047 <div class="paragraph"><p>These options take effect whatever the value of the <code>core.splitIndex</code>
 1048 configuration variable (see <a href="git-config.html">git-config(1)</a>). But a warning is
 1049 emitted when the change goes against the configured value, as the
 1050 configured value will take effect next time the index is read and this
 1051 will remove the intended effect of the option.</p></div>
 1052 </dd>
 1053 <dt class="hdlist1">
 1054 --untracked-cache
 1055 </dt>
 1056 <dt class="hdlist1">
 1057 --no-untracked-cache
 1058 </dt>
 1059 <dd>
 1060 <p>
 1061         Enable or disable untracked cache feature. Please use
 1062         <code>--test-untracked-cache</code> before enabling it.
 1063 </p>
 1064 <div class="paragraph"><p>These options take effect whatever the value of the <code>core.untrackedCache</code>
 1065 configuration variable (see <a href="git-config.html">git-config(1)</a>). But a warning is
 1066 emitted when the change goes against the configured value, as the
 1067 configured value will take effect next time the index is read and this
 1068 will remove the intended effect of the option.</p></div>
 1069 </dd>
 1070 <dt class="hdlist1">
 1071 --test-untracked-cache
 1072 </dt>
 1073 <dd>
 1074 <p>
 1075         Only perform tests on the working directory to make sure
 1076         untracked cache can be used. You have to manually enable
 1077         untracked cache using <code>--untracked-cache</code> or
 1078         <code>--force-untracked-cache</code> or the <code>core.untrackedCache</code>
 1079         configuration variable afterwards if you really want to use
 1080         it. If a test fails the exit code is 1 and a message
 1081         explains what is not working as needed, otherwise the exit
 1082         code is 0 and OK is printed.
 1083 </p>
 1084 </dd>
 1085 <dt class="hdlist1">
 1086 --force-untracked-cache
 1087 </dt>
 1088 <dd>
 1089 <p>
 1090         Same as <code>--untracked-cache</code>. Provided for backwards
 1091         compatibility with older versions of Git where
 1092         <code>--untracked-cache</code> used to imply <code>--test-untracked-cache</code> but
 1093         this option would enable the extension unconditionally.
 1094 </p>
 1095 </dd>
 1096 <dt class="hdlist1">
 1097 --fsmonitor
 1098 </dt>
 1099 <dt class="hdlist1">
 1100 --no-fsmonitor
 1101 </dt>
 1102 <dd>
 1103 <p>
 1104         Enable or disable files system monitor feature. These options
 1105         take effect whatever the value of the <code>core.fsmonitor</code>
 1106         configuration variable (see <a href="git-config.html">git-config(1)</a>). But a warning
 1107         is emitted when the change goes against the configured value, as
 1108         the configured value will take effect next time the index is
 1109         read and this will remove the intended effect of the option.
 1110 </p>
 1111 </dd>
 1112 <dt class="hdlist1">
 1113 --
 1114 </dt>
 1115 <dd>
 1116 <p>
 1117         Do not interpret any more arguments as options.
 1118 </p>
 1119 </dd>
 1120 <dt class="hdlist1">
 1121 &lt;file&gt;
 1122 </dt>
 1123 <dd>
 1124 <p>
 1125         Files to act on.
 1126         Note that files beginning with <em>.</em> are discarded. This includes
 1127         <code>./file</code> and <code>dir/./file</code>. If you don&#8217;t want this, then use
 1128         cleaner names.
 1129         The same applies to directories ending <em>/</em> and paths with <em>//</em>
 1130 </p>
 1131 </dd>
 1132 </dl></div>
 1133 </div>
 1134 </div>
 1135 <div class="sect1">
 1136 <h2 id="_using_refresh">USING --REFRESH</h2>
 1137 <div class="sectionbody">
 1138 <div class="paragraph"><p><code>--refresh</code> does not calculate a new sha1 file or bring the index
 1139 up to date for mode/content changes. But what it <strong>does</strong> do is to
 1140 "re-match" the stat information of a file with the index, so that you
 1141 can refresh the index for a file that hasn&#8217;t been changed but where
 1142 the stat entry is out of date.</p></div>
 1143 <div class="paragraph"><p>For example, you&#8217;d want to do this after doing a <em>git read-tree</em>, to link
 1144 up the stat index details with the proper files.</p></div>
 1145 </div>
 1146 </div>
 1147 <div class="sect1">
 1148 <h2 id="_using_cacheinfo_or_info_only">USING --CACHEINFO OR --INFO-ONLY</h2>
 1149 <div class="sectionbody">
 1150 <div class="paragraph"><p><code>--cacheinfo</code> is used to register a file that is not in the
 1151 current working directory.  This is useful for minimum-checkout
 1152 merging.</p></div>
 1153 <div class="paragraph"><p>To pretend you have a file at path with mode and sha1, say:</p></div>
 1154 <div class="listingblock">
 1155 <div class="content">
 1156 <pre><code>$ git update-index --add --cacheinfo &lt;mode&gt;,&lt;sha1&gt;,&lt;path&gt;</code></pre>
 1157 </div></div>
 1158 <div class="paragraph"><p><code>--info-only</code> is used to register files without placing them in the object
 1159 database.  This is useful for status-only repositories.</p></div>
 1160 <div class="paragraph"><p>Both <code>--cacheinfo</code> and <code>--info-only</code> behave similarly: the index is updated
 1161 but the object database isn&#8217;t.  <code>--cacheinfo</code> is useful when the object is
 1162 in the database but the file isn&#8217;t available locally.  <code>--info-only</code> is
 1163 useful when the file is available, but you do not wish to update the
 1164 object database.</p></div>
 1165 </div>
 1166 </div>
 1167 <div class="sect1">
 1168 <h2 id="_using_index_info">USING --INDEX-INFO</h2>
 1169 <div class="sectionbody">
 1170 <div class="paragraph"><p><code>--index-info</code> is a more powerful mechanism that lets you feed
 1171 multiple entry definitions from the standard input, and designed
 1172 specifically for scripts.  It can take inputs of three formats:</p></div>
 1173 <div class="olist arabic"><ol class="arabic">
 1174 <li>
 1175 <p>
 1176 mode SP type SP sha1          TAB path
 1177 </p>
 1178 <div class="paragraph"><p>This format is to stuff <code>git ls-tree</code> output into the index.</p></div>
 1179 </li>
 1180 <li>
 1181 <p>
 1182 mode         SP sha1 SP stage TAB path
 1183 </p>
 1184 <div class="paragraph"><p>This format is to put higher order stages into the
 1185 index file and matches <em>git ls-files --stage</em> output.</p></div>
 1186 </li>
 1187 <li>
 1188 <p>
 1189 mode         SP sha1          TAB path
 1190 </p>
 1191 <div class="paragraph"><p>This format is no longer produced by any Git command, but is
 1192 and will continue to be supported by <code>update-index --index-info</code>.</p></div>
 1193 </li>
 1194 </ol></div>
 1195 <div class="paragraph"><p>To place a higher stage entry to the index, the path should
 1196 first be removed by feeding a mode=0 entry for the path, and
 1197 then feeding necessary input lines in the third format.</p></div>
 1198 <div class="paragraph"><p>For example, starting with this index:</p></div>
 1199 <div class="listingblock">
 1200 <div class="content">
 1201 <pre><code>$ git ls-files -s
 1202 100644 8a1218a1024a212bb3db30becd860315f9f3ac52 0       frotz</code></pre>
 1203 </div></div>
 1204 <div class="paragraph"><p>you can feed the following input to <code>--index-info</code>:</p></div>
 1205 <div class="listingblock">
 1206 <div class="content">
 1207 <pre><code>$ git update-index --index-info
 1208 0 0000000000000000000000000000000000000000      frotz
 1209 100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1       frotz
 1210 100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2       frotz</code></pre>
 1211 </div></div>
 1212 <div class="paragraph"><p>The first line of the input feeds 0 as the mode to remove the
 1213 path; the SHA-1 does not matter as long as it is well formatted.
 1214 Then the second and third line feeds stage 1 and stage 2 entries
 1215 for that path.  After the above, we would end up with this:</p></div>
 1216 <div class="listingblock">
 1217 <div class="content">
 1218 <pre><code>$ git ls-files -s
 1219 100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1       frotz
 1220 100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2       frotz</code></pre>
 1221 </div></div>
 1222 </div>
 1223 </div>
 1224 <div class="sect1">
 1225 <h2 id="_using_8220_assume_unchanged_8221_bit">USING &#8220;ASSUME UNCHANGED&#8221; BIT</h2>
 1226 <div class="sectionbody">
 1227 <div class="paragraph"><p>Many operations in Git depend on your filesystem to have an
 1228 efficient <code>lstat(2)</code> implementation, so that <code>st_mtime</code>
 1229 information for working tree files can be cheaply checked to see
 1230 if the file contents have changed from the version recorded in
 1231 the index file.  Unfortunately, some filesystems have
 1232 inefficient <code>lstat(2)</code>.  If your filesystem is one of them, you
 1233 can set "assume unchanged" bit to paths you have not changed to
 1234 cause Git not to do this check.  Note that setting this bit on a
 1235 path does not mean Git will check the contents of the file to
 1236 see if it has changed&#8201;&#8212;&#8201;it makes Git to omit any checking and
 1237 assume it has <strong>not</strong> changed.  When you make changes to working
 1238 tree files, you have to explicitly tell Git about it by dropping
 1239 "assume unchanged" bit, either before or after you modify them.</p></div>
 1240 <div class="paragraph"><p>In order to set "assume unchanged" bit, use <code>--assume-unchanged</code>
 1241 option.  To unset, use <code>--no-assume-unchanged</code>. To see which files
 1242 have the "assume unchanged" bit set, use <code>git ls-files -v</code>
 1243 (see <a href="git-ls-files.html">git-ls-files(1)</a>).</p></div>
 1244 <div class="paragraph"><p>The command looks at <code>core.ignorestat</code> configuration variable.  When
 1245 this is true, paths updated with <code>git update-index paths...</code> and
 1246 paths updated with other Git commands that update both index and
 1247 working tree (e.g. <em>git apply --index</em>, <em>git checkout-index -u</em>,
 1248 and <em>git read-tree -u</em>) are automatically marked as "assume
 1249 unchanged".  Note that "assume unchanged" bit is <strong>not</strong> set if
 1250 <code>git update-index --refresh</code> finds the working tree file matches
 1251 the index (use <code>git update-index --really-refresh</code> if you want
 1252 to mark them as "assume unchanged").</p></div>
 1253 </div>
 1254 </div>
 1255 <div class="sect1">
 1256 <h2 id="_examples">EXAMPLES</h2>
 1257 <div class="sectionbody">
 1258 <div class="paragraph"><p>To update and refresh only the files already checked out:</p></div>
 1259 <div class="listingblock">
 1260 <div class="content">
 1261 <pre><code>$ git checkout-index -n -f -a &amp;&amp; git update-index --ignore-missing --refresh</code></pre>
 1262 </div></div>
 1263 <div class="dlist"><dl>
 1264 <dt class="hdlist1">
 1265 On an inefficient filesystem with <code>core.ignorestat</code> set
 1266 </dt>
 1267 <dd>
 1268 <div class="listingblock">
 1269 <div class="content">
 1270 <pre><code>$ git update-index --really-refresh              <b>&lt;1&gt;</b>
 1271 $ git update-index --no-assume-unchanged foo.c   <b>&lt;2&gt;</b>
 1272 $ git diff --name-only                           <b>&lt;3&gt;</b>
 1273 $ edit foo.c
 1274 $ git diff --name-only                           <b>&lt;4&gt;</b>
 1275 M foo.c
 1276 $ git update-index foo.c                         <b>&lt;5&gt;</b>
 1277 $ git diff --name-only                           <b>&lt;6&gt;</b>
 1278 $ edit foo.c
 1279 $ git diff --name-only                           <b>&lt;7&gt;</b>
 1280 $ git update-index --no-assume-unchanged foo.c   <b>&lt;8&gt;</b>
 1281 $ git diff --name-only                           <b>&lt;9&gt;</b>
 1282 M foo.c</code></pre>
 1283 </div></div>
 1284 <div class="colist arabic"><ol>
 1285 <li>
 1286 <p>
 1287 forces lstat(2) to set "assume unchanged" bits for paths that match index.
 1288 </p>
 1289 </li>
 1290 <li>
 1291 <p>
 1292 mark the path to be edited.
 1293 </p>
 1294 </li>
 1295 <li>
 1296 <p>
 1297 this does lstat(2) and finds index matches the path.
 1298 </p>
 1299 </li>
 1300 <li>
 1301 <p>
 1302 this does lstat(2) and finds index does <strong>not</strong> match the path.
 1303 </p>
 1304 </li>
 1305 <li>
 1306 <p>
 1307 registering the new version to index sets "assume unchanged" bit.
 1308 </p>
 1309 </li>
 1310 <li>
 1311 <p>
 1312 and it is assumed unchanged.
 1313 </p>
 1314 </li>
 1315 <li>
 1316 <p>
 1317 even after you edit it.
 1318 </p>
 1319 </li>
 1320 <li>
 1321 <p>
 1322 you can tell about the change after the fact.
 1323 </p>
 1324 </li>
 1325 <li>
 1326 <p>
 1327 now it checks with lstat(2) and finds it has been changed.
 1328 </p>
 1329 </li>
 1330 </ol></div>
 1331 </dd>
 1332 </dl></div>
 1333 </div>
 1334 </div>
 1335 <div class="sect1">
 1336 <h2 id="_skip_worktree_bit">SKIP-WORKTREE BIT</h2>
 1337 <div class="sectionbody">
 1338 <div class="paragraph"><p>Skip-worktree bit can be defined in one (long) sentence: When reading
 1339 an entry, if it is marked as skip-worktree, then Git pretends its
 1340 working directory version is up to date and read the index version
 1341 instead.</p></div>
 1342 <div class="paragraph"><p>To elaborate, "reading" means checking for file existence, reading
 1343 file attributes or file content. The working directory version may be
 1344 present or absent. If present, its content may match against the index
 1345 version or not. Writing is not affected by this bit, content safety
 1346 is still first priority. Note that Git <em>can</em> update working directory
 1347 file, that is marked skip-worktree, if it is safe to do so (i.e.
 1348 working directory version matches index version)</p></div>
 1349 <div class="paragraph"><p>Although this bit looks similar to assume-unchanged bit, its goal is
 1350 different from assume-unchanged bit&#8217;s. Skip-worktree also takes
 1351 precedence over assume-unchanged bit when both are set.</p></div>
 1352 </div>
 1353 </div>
 1354 <div class="sect1">
 1355 <h2 id="_split_index">SPLIT INDEX</h2>
 1356 <div class="sectionbody">
 1357 <div class="paragraph"><p>This mode is designed for repositories with very large indexes, and
 1358 aims at reducing the time it takes to repeatedly write these indexes.</p></div>
 1359 <div class="paragraph"><p>In this mode, the index is split into two files, $GIT_DIR/index and
 1360 $GIT_DIR/sharedindex.&lt;SHA-1&gt;. Changes are accumulated in
 1361 $GIT_DIR/index, the split index, while the shared index file contains
 1362 all index entries and stays unchanged.</p></div>
 1363 <div class="paragraph"><p>All changes in the split index are pushed back to the shared index
 1364 file when the number of entries in the split index reaches a level
 1365 specified by the splitIndex.maxPercentChange config variable (see
 1366 <a href="git-config.html">git-config(1)</a>).</p></div>
 1367 <div class="paragraph"><p>Each time a new shared index file is created, the old shared index
 1368 files are deleted if their modification time is older than what is
 1369 specified by the splitIndex.sharedIndexExpire config variable (see
 1370 <a href="git-config.html">git-config(1)</a>).</p></div>
 1371 <div class="paragraph"><p>To avoid deleting a shared index file that is still used, its
 1372 modification time is updated to the current time everytime a new split
 1373 index based on the shared index file is either created or read from.</p></div>
 1374 </div>
 1375 </div>
 1376 <div class="sect1">
 1377 <h2 id="_untracked_cache">UNTRACKED CACHE</h2>
 1378 <div class="sectionbody">
 1379 <div class="paragraph"><p>This cache is meant to speed up commands that involve determining
 1380 untracked files such as <code>git status</code>.</p></div>
 1381 <div class="paragraph"><p>This feature works by recording the mtime of the working tree
 1382 directories and then omitting reading directories and stat calls
 1383 against files in those directories whose mtime hasn&#8217;t changed. For
 1384 this to work the underlying operating system and file system must
 1385 change the <code>st_mtime</code> field of directories if files in the directory
 1386 are added, modified or deleted.</p></div>
 1387 <div class="paragraph"><p>You can test whether the filesystem supports that with the
 1388 <code>--test-untracked-cache</code> option. The <code>--untracked-cache</code> option used
 1389 to implicitly perform that test in older versions of Git, but that&#8217;s
 1390 no longer the case.</p></div>
 1391 <div class="paragraph"><p>If you want to enable (or disable) this feature, it is easier to use
 1392 the <code>core.untrackedCache</code> configuration variable (see
 1393 <a href="git-config.html">git-config(1)</a>) than using the <code>--untracked-cache</code> option to
 1394 <code>git update-index</code> in each repository, especially if you want to do so
 1395 across all repositories you use, because you can set the configuration
 1396 variable to <code>true</code> (or <code>false</code>) in your <code>$HOME/.gitconfig</code> just once
 1397 and have it affect all repositories you touch.</p></div>
 1398 <div class="paragraph"><p>When the <code>core.untrackedCache</code> configuration variable is changed, the
 1399 untracked cache is added to or removed from the index the next time a
 1400 command reads the index; while when <code>--[no-|force-]untracked-cache</code>
 1401 are used, the untracked cache is immediately added to or removed from
 1402 the index.</p></div>
 1403 <div class="paragraph"><p>Before 2.17, the untracked cache had a bug where replacing a directory
 1404 with a symlink to another directory could cause it to incorrectly show
 1405 files tracked by git as untracked. See the "status: add a failing test
 1406 showing a core.untrackedCache bug" commit to git.git. A workaround for
 1407 that is (and this might work for other undiscovered bugs in the
 1408 future):</p></div>
 1409 <div class="listingblock">
 1410 <div class="content">
 1411 <pre><code>$ git -c core.untrackedCache=false status</code></pre>
 1412 </div></div>
 1413 <div class="paragraph"><p>This bug has also been shown to affect non-symlink cases of replacing
 1414 a directory with a file when it comes to the internal structures of
 1415 the untracked cache, but no case has been reported where this resulted in
 1416 wrong "git status" output.</p></div>
 1417 <div class="paragraph"><p>There are also cases where existing indexes written by git versions
 1418 before 2.17 will reference directories that don&#8217;t exist anymore,
 1419 potentially causing many "could not open directory" warnings to be
 1420 printed on "git status". These are new warnings for existing issues
 1421 that were previously silently discarded.</p></div>
 1422 <div class="paragraph"><p>As with the bug described above the solution is to one-off do a "git
 1423 status" run with <code>core.untrackedCache=false</code> to flush out the leftover
 1424 bad data.</p></div>
 1425 </div>
 1426 </div>
 1427 <div class="sect1">
 1428 <h2 id="_file_system_monitor">FILE SYSTEM MONITOR</h2>
 1429 <div class="sectionbody">
 1430 <div class="paragraph"><p>This feature is intended to speed up git operations for repos that have
 1431 large working directories.</p></div>
 1432 <div class="paragraph"><p>It enables git to work together with a file system monitor (see the
 1433 "fsmonitor-watchman" section of <a href="githooks.html">githooks(5)</a>) that can
 1434 inform it as to what files have been modified. This enables git to avoid
 1435 having to lstat() every file to find modified files.</p></div>
 1436 <div class="paragraph"><p>When used in conjunction with the untracked cache, it can further improve
 1437 performance by avoiding the cost of scanning the entire working directory
 1438 looking for new files.</p></div>
 1439 <div class="paragraph"><p>If you want to enable (or disable) this feature, it is easier to use
 1440 the <code>core.fsmonitor</code> configuration variable (see
 1441 <a href="git-config.html">git-config(1)</a>) than using the <code>--fsmonitor</code> option to
 1442 <code>git update-index</code> in each repository, especially if you want to do so
 1443 across all repositories you use, because you can set the configuration
 1444 variable in your <code>$HOME/.gitconfig</code> just once and have it affect all
 1445 repositories you touch.</p></div>
 1446 <div class="paragraph"><p>When the <code>core.fsmonitor</code> configuration variable is changed, the
 1447 file system monitor is added to or removed from the index the next time
 1448 a command reads the index. When <code>--[no-]fsmonitor</code> are used, the file
 1449 system monitor is immediately added to or removed from the index.</p></div>
 1450 </div>
 1451 </div>
 1452 <div class="sect1">
 1453 <h2 id="_configuration">CONFIGURATION</h2>
 1454 <div class="sectionbody">
 1455 <div class="paragraph"><p>The command honors <code>core.filemode</code> configuration variable.  If
 1456 your repository is on a filesystem whose executable bits are
 1457 unreliable, this should be set to <em>false</em> (see <a href="git-config.html">git-config(1)</a>).
 1458 This causes the command to ignore differences in file modes recorded
 1459 in the index and the file mode on the filesystem if they differ only on
 1460 executable bit.   On such an unfortunate filesystem, you may
 1461 need to use <em>git update-index --chmod=</em>.</p></div>
 1462 <div class="paragraph"><p>Quite similarly, if <code>core.symlinks</code> configuration variable is set
 1463 to <em>false</em> (see <a href="git-config.html">git-config(1)</a>), symbolic links are checked out
 1464 as plain files, and this command does not modify a recorded file mode
 1465 from symbolic link to regular file.</p></div>
 1466 <div class="paragraph"><p>The command looks at <code>core.ignorestat</code> configuration variable.  See
 1467 <em>Using "assume unchanged" bit</em> section above.</p></div>
 1468 <div class="paragraph"><p>The command also looks at <code>core.trustctime</code> configuration variable.
 1469 It can be useful when the inode change time is regularly modified by
 1470 something outside Git (file system crawlers and backup systems use
 1471 ctime for marking files processed) (see <a href="git-config.html">git-config(1)</a>).</p></div>
 1472 <div class="paragraph"><p>The untracked cache extension can be enabled by the
 1473 <code>core.untrackedCache</code> configuration variable (see
 1474 <a href="git-config.html">git-config(1)</a>).</p></div>
 1475 </div>
 1476 </div>
 1477 <div class="sect1">
 1478 <h2 id="_see_also">SEE ALSO</h2>
 1479 <div class="sectionbody">
 1480 <div class="paragraph"><p><a href="git-config.html">git-config(1)</a>,
 1481 <a href="git-add.html">git-add(1)</a>,
 1482 <a href="git-ls-files.html">git-ls-files(1)</a></p></div>
 1483 </div>
 1484 </div>
 1485 <div class="sect1">
 1486 <h2 id="_git">GIT</h2>
 1487 <div class="sectionbody">
 1488 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
 1489 </div>
 1490 </div>
 1491 </div>
 1492 <div id="footnotes"><hr /></div>
 1493 <div id="footer">
 1494 <div id="footer-text">
 1495 Last updated
 1496  2018-12-15 13:04:49 JST
 1497 </div>
 1498 </div>
 1499 </body>
 1500 </html>