Autogenerated HTML docs for v2.45.2-404-g9eaef
[git-htmldocs.git] / git-update-index.html
blobe4b436ae456e1a6650dd737ecd53fc0baf63800b
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 10.2.0" />
8 <title>git-update-index(1)</title>
9 <style type="text/css">
10 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
12 /* Default font. */
13 body {
14 font-family: Georgia,serif;
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;
27 body {
28 margin: 1em 5% 1em 5%;
31 a {
32 color: blue;
33 text-decoration: underline;
35 a:visited {
36 color: fuchsia;
39 em {
40 font-style: italic;
41 color: navy;
44 strong {
45 font-weight: bold;
46 color: #083194;
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;
56 h1, h2, h3 {
57 border-bottom: 2px solid silver;
59 h2 {
60 padding-top: 0.5em;
62 h3 {
63 float: left;
65 h3 + * {
66 clear: left;
68 h5 {
69 font-size: 1.0em;
72 div.sectionbody {
73 margin-left: 0;
76 hr {
77 border: 1px solid silver;
80 p {
81 margin-top: 0.5em;
82 margin-bottom: 0.5em;
85 ul, ol, li > p {
86 margin-top: 0;
88 ul > li { color: #aaa; }
89 ul > li > * { color: black; }
91 .monospaced, code, pre {
92 font-family: "Courier New", Courier, monospace;
93 font-size: inherit;
94 color: navy;
95 padding: 0;
96 margin: 0;
98 pre {
99 white-space: pre-wrap;
102 #author {
103 color: #527bbd;
104 font-weight: bold;
105 font-size: 1.1em;
107 #email {
109 #revnumber, #revdate, #revremark {
112 #footer {
113 font-size: small;
114 border-top: 2px solid silver;
115 padding-top: 0.5em;
116 margin-top: 4.0em;
118 #footer-text {
119 float: left;
120 padding-bottom: 0.5em;
122 #footer-badges {
123 float: right;
124 padding-bottom: 0.5em;
127 #preamble {
128 margin-top: 1.5em;
129 margin-bottom: 1.5em;
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;
137 div.admonitionblock {
138 margin-top: 2.0em;
139 margin-bottom: 2.0em;
140 margin-right: 10%;
141 color: #606060;
144 div.content { /* Block element content. */
145 padding: 0;
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;
156 div.title + * {
157 margin-top: 0;
160 td div.title:first-child {
161 margin-top: 0.0em;
163 div.content div.title:first-child {
164 margin-top: 0.0em;
166 div.content + div.title {
167 margin-top: 0.0em;
170 div.sidebarblock > div.content {
171 background: #ffffee;
172 border: 1px solid #dddddd;
173 border-left: 4px solid #f0f0f0;
174 padding: 0.5em;
177 div.listingblock > div.content {
178 border: 1px solid #dddddd;
179 border-left: 5px solid #f0f0f0;
180 background: #f8f8f8;
181 padding: 0.5em;
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;
192 div.quoteblock > div.attribution {
193 padding-top: 0.5em;
194 text-align: right;
197 div.verseblock > pre.content {
198 font-family: inherit;
199 font-size: inherit;
201 div.verseblock > div.attribution {
202 padding-top: 0.75em;
203 text-align: left;
205 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
206 div.verseblock + div.attribution {
207 text-align: left;
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;
218 div.admonitionblock td.content {
219 padding-left: 0.5em;
220 border-left: 3px solid #dddddd;
223 div.exampleblock > div.content {
224 border-left: 3px solid #dddddd;
225 padding-left: 0.5em;
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; }
232 dl {
233 margin-top: 0.8em;
234 margin-bottom: 0.8em;
236 dt {
237 margin-top: 0.5em;
238 margin-bottom: 0;
239 font-style: normal;
240 color: navy;
242 dd > *:first-child {
243 margin-top: 0.1em;
246 ul, ol {
247 list-style-position: outside;
249 ol.arabic {
250 list-style-type: decimal;
252 ol.loweralpha {
253 list-style-type: lower-alpha;
255 ol.upperalpha {
256 list-style-type: upper-alpha;
258 ol.lowerroman {
259 list-style-type: lower-roman;
261 ol.upperroman {
262 list-style-type: upper-roman;
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;
272 tfoot {
273 font-weight: bold;
275 td > div.verse {
276 white-space: pre;
279 div.hdlist {
280 margin-top: 0.8em;
281 margin-bottom: 0.8em;
283 div.hdlist tr {
284 padding-bottom: 15px;
286 dt.hdlist1.strong, td.hdlist1.strong {
287 font-weight: bold;
289 td.hdlist1 {
290 vertical-align: top;
291 font-style: normal;
292 padding-right: 0.8em;
293 color: navy;
295 td.hdlist2 {
296 vertical-align: top;
298 div.hdlist.compact tr {
299 margin: 0;
300 padding-bottom: 0;
303 .comment {
304 background: yellow;
307 .footnote, .footnoteref {
308 font-size: 0.8em;
311 span.footnote, span.footnoteref {
312 vertical-align: super;
315 #footnotes {
316 margin: 20px 0 20px 0;
317 padding: 7px 0 0 0;
320 #footnotes div.footnote {
321 margin: 0 0 5px 0;
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;
334 div.colist td {
335 padding-right: 0.5em;
336 padding-bottom: 0.3em;
337 vertical-align: top;
339 div.colist td img {
340 margin-top: 0.3em;
343 @media print {
344 #footer-badges { display: none; }
347 #toc {
348 margin-bottom: 2.5em;
351 #toctitle {
352 color: #527bbd;
353 font-size: 1.1em;
354 font-weight: bold;
355 margin-top: 1.0em;
356 margin-bottom: 0.1em;
359 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
360 margin-top: 0;
361 margin-bottom: 0;
363 div.toclevel2 {
364 margin-left: 2em;
365 font-size: 0.9em;
367 div.toclevel3 {
368 margin-left: 4em;
369 font-size: 0.9em;
371 div.toclevel4 {
372 margin-left: 6em;
373 font-size: 0.9em;
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; }
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; }
410 span.big { font-size: 2em; }
411 span.small { font-size: 0.6em; }
413 span.underline { text-decoration: underline; }
414 span.overline { text-decoration: overline; }
415 span.line-through { text-decoration: line-through; }
417 div.unbreakable { page-break-inside: avoid; }
421 * xhtml11 specific
423 * */
425 div.tableblock {
426 margin-top: 1.0em;
427 margin-bottom: 1.5em;
429 div.tableblock > table {
430 border: 3px solid #527bbd;
432 thead, p.table.header {
433 font-weight: bold;
434 color: #527bbd;
436 p.table {
437 margin-top: 0;
439 /* Because the table frame attribute is overridden by CSS in most browsers. */
440 div.tableblock > table[frame="void"] {
441 border-style: none;
443 div.tableblock > table[frame="hsides"] {
444 border-left-style: none;
445 border-right-style: none;
447 div.tableblock > table[frame="vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
454 * html5 specific
456 * */
458 table.tableblock {
459 margin-top: 1.0em;
460 margin-bottom: 1.5em;
462 thead, p.tableblock.header {
463 font-weight: bold;
464 color: #527bbd;
466 p.tableblock {
467 margin-top: 0;
469 table.tableblock {
470 border-width: 3px;
471 border-spacing: 0px;
472 border-style: solid;
473 border-color: #527bbd;
474 border-collapse: collapse;
476 th.tableblock, td.tableblock {
477 border-width: 1px;
478 padding: 4px;
479 border-style: solid;
480 border-color: #527bbd;
483 table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
487 table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
491 table.tableblock.frame-none {
492 border-style: hidden;
495 th.tableblock.halign-left, td.tableblock.halign-left {
496 text-align: left;
498 th.tableblock.halign-center, td.tableblock.halign-center {
499 text-align: center;
501 th.tableblock.halign-right, td.tableblock.halign-right {
502 text-align: right;
505 th.tableblock.valign-top, td.tableblock.valign-top {
506 vertical-align: top;
508 th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
511 th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
517 * manpage specific
519 * */
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;
527 body.manpage h2 {
528 border-style: none;
530 body.manpage div.sectionbody {
531 margin-left: 3em;
534 @media print {
535 body.manpage div#toc { display: none; }
539 </style>
540 <script type="text/javascript">
541 /*<![CDATA[*/
542 var asciidoc = { // Namespace.
544 /////////////////////////////////////////////////////////////////////
545 // Table Of Contents generator
546 /////////////////////////////////////////////////////////////////////
548 /* Author: Mihai Bazon, September 2002
549 * http://students.infoiasi.ro/~mishoo
551 * Table Of Content generator
552 * Version: 0.4
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.
558 /* modified by Troy D. Hanson, September 2006. License: GPL */
559 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
561 // toclevels = 1..4.
562 toc: function (toclevels) {
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);
572 return text;
575 function TocEntry(el, text, toclevel) {
576 this.element = el;
577 this.text = text;
578 this.toclevel = toclevel;
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);
594 iterate(i);
598 iterate(el);
599 return result;
602 var toc = document.getElementById("toc");
603 if (!toc) {
604 return;
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);
617 for (i = 0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
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);
635 if (entries.length == 0)
636 toc.parentNode.removeChild(toc);
640 /////////////////////////////////////////////////////////////////////
641 // Footnotes generator
642 /////////////////////////////////////////////////////////////////////
644 /* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
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;
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);
661 for (i = 0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
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);
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;
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>]";
708 install: function(toclevels) {
709 var timerId;
711 function reinstall() {
712 asciidoc.footnotes();
713 if (toclevels) {
714 asciidoc.toc(toclevels);
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
720 reinstall();
723 timerId = setInterval(reinstall, 500);
724 if (document.addEventListener)
725 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
726 else
727 window.onload = reinstallAndRemoveTimer;
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-]ignore-skip-worktree-entries]
760 [--[no-]fsmonitor-valid]
761 [--ignore-submodules]
762 [--[no-]split-index]
763 [--[no-|test-|force-]untracked-cache]
764 [--[no-]fsmonitor]
765 [--really-refresh] [--unresolve] [--again | -g]
766 [--info-only] [--index-info]
767 [-z] [--stdin] [--index-version &lt;n&gt;]
768 [--show-index-version]
769 [--verbose]
770 [--] [&lt;file&gt;&#8230;]</pre>
771 <div class="attribution">
772 </div></div>
773 </div>
774 </div>
775 <div class="sect1">
776 <h2 id="_description">DESCRIPTION</h2>
777 <div class="sectionbody">
778 <div class="paragraph"><p>Modifies the index. Each file mentioned is updated into the index and
779 any <em>unmerged</em> or <em>needs updating</em> state is cleared.</p></div>
780 <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
781 the most common operations on the index.</p></div>
782 <div class="paragraph"><p>The way <em>git update-index</em> handles files it is told about can be modified
783 using the various options:</p></div>
784 </div>
785 </div>
786 <div class="sect1">
787 <h2 id="_options">OPTIONS</h2>
788 <div class="sectionbody">
789 <div class="dlist"><dl>
790 <dt class="hdlist1">
791 --add
792 </dt>
793 <dd>
795 If a specified file isn&#8217;t in the index already then it&#8217;s
796 added.
797 Default behaviour is to ignore new files.
798 </p>
799 </dd>
800 <dt class="hdlist1">
801 --remove
802 </dt>
803 <dd>
805 If a specified file is in the index but is missing then it&#8217;s
806 removed.
807 Default behavior is to ignore removed files.
808 </p>
809 </dd>
810 <dt class="hdlist1">
811 --refresh
812 </dt>
813 <dd>
815 Looks at the current index and checks to see if merges or
816 updates are needed by checking stat() information.
817 </p>
818 </dd>
819 <dt class="hdlist1">
821 </dt>
822 <dd>
824 Quiet. If --refresh finds that the index needs an update, the
825 default behavior is to error out. This option makes
826 <em>git update-index</em> continue anyway.
827 </p>
828 </dd>
829 <dt class="hdlist1">
830 --ignore-submodules
831 </dt>
832 <dd>
834 Do not try to update submodules. This option is only respected
835 when passed before --refresh.
836 </p>
837 </dd>
838 <dt class="hdlist1">
839 --unmerged
840 </dt>
841 <dd>
843 If --refresh finds unmerged changes in the index, the default
844 behavior is to error out. This option makes <em>git update-index</em>
845 continue anyway.
846 </p>
847 </dd>
848 <dt class="hdlist1">
849 --ignore-missing
850 </dt>
851 <dd>
853 Ignores missing files during a --refresh
854 </p>
855 </dd>
856 <dt class="hdlist1">
857 --cacheinfo &lt;mode&gt;,&lt;object&gt;,&lt;path&gt;
858 </dt>
859 <dt class="hdlist1">
860 --cacheinfo &lt;mode&gt; &lt;object&gt; &lt;path&gt;
861 </dt>
862 <dd>
864 Directly insert the specified info into the index. For
865 backward compatibility, you can also give these three
866 arguments as three separate parameters, but new users are
867 encouraged to use a single-parameter form.
868 </p>
869 </dd>
870 <dt class="hdlist1">
871 --index-info
872 </dt>
873 <dd>
875 Read index information from stdin.
876 </p>
877 </dd>
878 <dt class="hdlist1">
879 --chmod=(+|-)x
880 </dt>
881 <dd>
883 Set the execute permissions on the updated files.
884 </p>
885 </dd>
886 <dt class="hdlist1">
887 --[no-]assume-unchanged
888 </dt>
889 <dd>
891 When this flag is specified, the object names recorded
892 for the paths are not updated. Instead, this option
893 sets/unsets the "assume unchanged" bit for the
894 paths. When the "assume unchanged" bit is on, the user
895 promises not to change the file and allows Git to assume
896 that the working tree file matches what is recorded in
897 the index. If you want to change the working tree file,
898 you need to unset the bit to tell Git. This is
899 sometimes helpful when working with a big project on a
900 filesystem that has a very slow lstat(2) system call
901 (e.g. cifs).
902 </p>
903 <div class="paragraph"><p>Git will fail (gracefully) in case it needs to modify this file
904 in the index e.g. when merging in a commit;
905 thus, in case the assumed-untracked file is changed upstream,
906 you will need to handle the situation manually.</p></div>
907 </dd>
908 <dt class="hdlist1">
909 --really-refresh
910 </dt>
911 <dd>
913 Like <code>--refresh</code>, but checks stat information unconditionally,
914 without regard to the "assume unchanged" setting.
915 </p>
916 </dd>
917 <dt class="hdlist1">
918 --[no-]skip-worktree
919 </dt>
920 <dd>
922 When one of these flags is specified, the object names recorded
923 for the paths are not updated. Instead, these options
924 set and unset the "skip-worktree" bit for the paths. See
925 section "Skip-worktree bit" below for more information.
926 </p>
927 </dd>
928 <dt class="hdlist1">
929 --[no-]ignore-skip-worktree-entries
930 </dt>
931 <dd>
933 Do not remove skip-worktree (AKA "index-only") entries even when
934 the <code>--remove</code> option was specified.
935 </p>
936 </dd>
937 <dt class="hdlist1">
938 --[no-]fsmonitor-valid
939 </dt>
940 <dd>
942 When one of these flags is specified, the object names recorded
943 for the paths are not updated. Instead, these options
944 set and unset the "fsmonitor valid" bit for the paths. See
945 section "File System Monitor" below for more information.
946 </p>
947 </dd>
948 <dt class="hdlist1">
950 </dt>
951 <dt class="hdlist1">
952 --again
953 </dt>
954 <dd>
956 Runs <em>git update-index</em> itself on the paths whose index
957 entries are different from those of the <code>HEAD</code> commit.
958 </p>
959 </dd>
960 <dt class="hdlist1">
961 --unresolve
962 </dt>
963 <dd>
965 Restores the <em>unmerged</em> or <em>needs updating</em> state of a
966 file during a merge if it was cleared by accident.
967 </p>
968 </dd>
969 <dt class="hdlist1">
970 --info-only
971 </dt>
972 <dd>
974 Do not create objects in the object database for all
975 &lt;file&gt; arguments that follow this flag; just insert
976 their object IDs into the index.
977 </p>
978 </dd>
979 <dt class="hdlist1">
980 --force-remove
981 </dt>
982 <dd>
984 Remove the file from the index even when the working directory
985 still has such a file. (Implies --remove.)
986 </p>
987 </dd>
988 <dt class="hdlist1">
989 --replace
990 </dt>
991 <dd>
993 By default, when a file <code>path</code> exists in the index,
994 <em>git update-index</em> refuses an attempt to add <code>path/file</code>.
995 Similarly if a file <code>path/file</code> exists, a file <code>path</code>
996 cannot be added. With --replace flag, existing entries
997 that conflict with the entry being added are
998 automatically removed with warning messages.
999 </p>
1000 </dd>
1001 <dt class="hdlist1">
1002 --stdin
1003 </dt>
1004 <dd>
1006 Instead of taking a list of paths from the command line,
1007 read a list of paths from the standard input. Paths are
1008 separated by LF (i.e. one path per line) by default.
1009 </p>
1010 </dd>
1011 <dt class="hdlist1">
1012 --verbose
1013 </dt>
1014 <dd>
1016 Report what is being added and removed from the index.
1017 </p>
1018 </dd>
1019 <dt class="hdlist1">
1020 --index-version &lt;n&gt;
1021 </dt>
1022 <dd>
1024 Write the resulting index out in the named on-disk format version.
1025 Supported versions are 2, 3, and 4. The current default version is 2
1026 or 3, depending on whether extra features are used, such as
1027 <code>git add -N</code>. With <code>--verbose</code>, also report the version the index
1028 file uses before and after this command.
1029 </p>
1030 <div class="paragraph"><p>Version 4 performs a simple pathname compression that reduces index
1031 size by 30%-50% on large repositories, which results in faster load
1032 time. Git supports it since version 1.8.0, released in October 2012,
1033 and support for it was added to libgit2 in 2016 and to JGit in 2020.
1034 Older versions of this manual page called it "relatively young", but
1035 it should be considered mature technology these days.</p></div>
1036 </dd>
1037 <dt class="hdlist1">
1038 --show-index-version
1039 </dt>
1040 <dd>
1042 Report the index format version used by the on-disk index file.
1043 See <code>--index-version</code> above.
1044 </p>
1045 </dd>
1046 <dt class="hdlist1">
1048 </dt>
1049 <dd>
1051 Only meaningful with <code>--stdin</code> or <code>--index-info</code>; paths are
1052 separated with NUL character instead of LF.
1053 </p>
1054 </dd>
1055 <dt class="hdlist1">
1056 --split-index
1057 </dt>
1058 <dt class="hdlist1">
1059 --no-split-index
1060 </dt>
1061 <dd>
1063 Enable or disable split index mode. If split-index mode is
1064 already enabled and <code>--split-index</code> is given again, all
1065 changes in $GIT_DIR/index are pushed back to the shared index
1066 file.
1067 </p>
1068 <div class="paragraph"><p>These options take effect whatever the value of the <code>core.splitIndex</code>
1069 configuration variable (see <a href="git-config.html">git-config(1)</a>). But a warning is
1070 emitted when the change goes against the configured value, as the
1071 configured value will take effect next time the index is read and this
1072 will remove the intended effect of the option.</p></div>
1073 </dd>
1074 <dt class="hdlist1">
1075 --untracked-cache
1076 </dt>
1077 <dt class="hdlist1">
1078 --no-untracked-cache
1079 </dt>
1080 <dd>
1082 Enable or disable untracked cache feature. Please use
1083 <code>--test-untracked-cache</code> before enabling it.
1084 </p>
1085 <div class="paragraph"><p>These options take effect whatever the value of the <code>core.untrackedCache</code>
1086 configuration variable (see <a href="git-config.html">git-config(1)</a>). But a warning is
1087 emitted when the change goes against the configured value, as the
1088 configured value will take effect next time the index is read and this
1089 will remove the intended effect of the option.</p></div>
1090 </dd>
1091 <dt class="hdlist1">
1092 --test-untracked-cache
1093 </dt>
1094 <dd>
1096 Only perform tests on the working directory to make sure
1097 untracked cache can be used. You have to manually enable
1098 untracked cache using <code>--untracked-cache</code> or
1099 <code>--force-untracked-cache</code> or the <code>core.untrackedCache</code>
1100 configuration variable afterwards if you really want to use
1101 it. If a test fails the exit code is 1 and a message
1102 explains what is not working as needed, otherwise the exit
1103 code is 0 and OK is printed.
1104 </p>
1105 </dd>
1106 <dt class="hdlist1">
1107 --force-untracked-cache
1108 </dt>
1109 <dd>
1111 Same as <code>--untracked-cache</code>. Provided for backwards
1112 compatibility with older versions of Git where
1113 <code>--untracked-cache</code> used to imply <code>--test-untracked-cache</code> but
1114 this option would enable the extension unconditionally.
1115 </p>
1116 </dd>
1117 <dt class="hdlist1">
1118 --fsmonitor
1119 </dt>
1120 <dt class="hdlist1">
1121 --no-fsmonitor
1122 </dt>
1123 <dd>
1125 Enable or disable files system monitor feature. These options
1126 take effect whatever the value of the <code>core.fsmonitor</code>
1127 configuration variable (see <a href="git-config.html">git-config(1)</a>). But a warning
1128 is emitted when the change goes against the configured value, as
1129 the configured value will take effect next time the index is
1130 read and this will remove the intended effect of the option.
1131 </p>
1132 </dd>
1133 <dt class="hdlist1">
1135 </dt>
1136 <dd>
1138 Do not interpret any more arguments as options.
1139 </p>
1140 </dd>
1141 <dt class="hdlist1">
1142 &lt;file&gt;
1143 </dt>
1144 <dd>
1146 Files to act on.
1147 Note that files beginning with <em>.</em> are discarded. This includes
1148 <code>./file</code> and <code>dir/./file</code>. If you don&#8217;t want this, then use
1149 cleaner names.
1150 The same applies to directories ending <em>/</em> and paths with <em>//</em>
1151 </p>
1152 </dd>
1153 </dl></div>
1154 </div>
1155 </div>
1156 <div class="sect1">
1157 <h2 id="_using_refresh">USING --REFRESH</h2>
1158 <div class="sectionbody">
1159 <div class="paragraph"><p><code>--refresh</code> does not calculate a new sha1 file or bring the index
1160 up to date for mode/content changes. But what it <strong>does</strong> do is to
1161 "re-match" the stat information of a file with the index, so that you
1162 can refresh the index for a file that hasn&#8217;t been changed but where
1163 the stat entry is out of date.</p></div>
1164 <div class="paragraph"><p>For example, you&#8217;d want to do this after doing a <em>git read-tree</em>, to link
1165 up the stat index details with the proper files.</p></div>
1166 </div>
1167 </div>
1168 <div class="sect1">
1169 <h2 id="_using_cacheinfo_or_info_only">USING --CACHEINFO OR --INFO-ONLY</h2>
1170 <div class="sectionbody">
1171 <div class="paragraph"><p><code>--cacheinfo</code> is used to register a file that is not in the
1172 current working directory. This is useful for minimum-checkout
1173 merging.</p></div>
1174 <div class="paragraph"><p>To pretend you have a file at path with mode and sha1, say:</p></div>
1175 <div class="listingblock">
1176 <div class="content">
1177 <pre><code>$ git update-index --add --cacheinfo &lt;mode&gt;,&lt;sha1&gt;,&lt;path&gt;</code></pre>
1178 </div></div>
1179 <div class="paragraph"><p><code>--info-only</code> is used to register files without placing them in the object
1180 database. This is useful for status-only repositories.</p></div>
1181 <div class="paragraph"><p>Both <code>--cacheinfo</code> and <code>--info-only</code> behave similarly: the index is updated
1182 but the object database isn&#8217;t. <code>--cacheinfo</code> is useful when the object is
1183 in the database but the file isn&#8217;t available locally. <code>--info-only</code> is
1184 useful when the file is available, but you do not wish to update the
1185 object database.</p></div>
1186 </div>
1187 </div>
1188 <div class="sect1">
1189 <h2 id="_using_index_info">USING --INDEX-INFO</h2>
1190 <div class="sectionbody">
1191 <div class="paragraph"><p><code>--index-info</code> is a more powerful mechanism that lets you feed
1192 multiple entry definitions from the standard input, and designed
1193 specifically for scripts. It can take inputs of three formats:</p></div>
1194 <div class="olist arabic"><ol class="arabic">
1195 <li>
1197 mode SP type SP sha1 TAB path
1198 </p>
1199 <div class="paragraph"><p>This format is to stuff <code>git ls-tree</code> output into the index.</p></div>
1200 </li>
1201 <li>
1203 mode SP sha1 SP stage TAB path
1204 </p>
1205 <div class="paragraph"><p>This format is to put higher order stages into the
1206 index file and matches <em>git ls-files --stage</em> output.</p></div>
1207 </li>
1208 <li>
1210 mode SP sha1 TAB path
1211 </p>
1212 <div class="paragraph"><p>This format is no longer produced by any Git command, but is
1213 and will continue to be supported by <code>update-index --index-info</code>.</p></div>
1214 </li>
1215 </ol></div>
1216 <div class="paragraph"><p>To place a higher stage entry to the index, the path should
1217 first be removed by feeding a mode=0 entry for the path, and
1218 then feeding necessary input lines in the third format.</p></div>
1219 <div class="paragraph"><p>For example, starting with this index:</p></div>
1220 <div class="listingblock">
1221 <div class="content">
1222 <pre><code>$ git ls-files -s
1223 100644 8a1218a1024a212bb3db30becd860315f9f3ac52 0 frotz</code></pre>
1224 </div></div>
1225 <div class="paragraph"><p>you can feed the following input to <code>--index-info</code>:</p></div>
1226 <div class="listingblock">
1227 <div class="content">
1228 <pre><code>$ git update-index --index-info
1229 0 0000000000000000000000000000000000000000 frotz
1230 100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1 frotz
1231 100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2 frotz</code></pre>
1232 </div></div>
1233 <div class="paragraph"><p>The first line of the input feeds 0 as the mode to remove the
1234 path; the SHA-1 does not matter as long as it is well formatted.
1235 Then the second and third line feeds stage 1 and stage 2 entries
1236 for that path. After the above, we would end up with this:</p></div>
1237 <div class="listingblock">
1238 <div class="content">
1239 <pre><code>$ git ls-files -s
1240 100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1 frotz
1241 100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2 frotz</code></pre>
1242 </div></div>
1243 </div>
1244 </div>
1245 <div class="sect1">
1246 <h2 id="_using_8220_assume_unchanged_8221_bit">USING &#8220;ASSUME UNCHANGED&#8221; BIT</h2>
1247 <div class="sectionbody">
1248 <div class="paragraph"><p>Many operations in Git depend on your filesystem to have an
1249 efficient <code>lstat(2)</code> implementation, so that <code>st_mtime</code>
1250 information for working tree files can be cheaply checked to see
1251 if the file contents have changed from the version recorded in
1252 the index file. Unfortunately, some filesystems have
1253 inefficient <code>lstat(2)</code>. If your filesystem is one of them, you
1254 can set "assume unchanged" bit to paths you have not changed to
1255 cause Git not to do this check. Note that setting this bit on a
1256 path does not mean Git will check the contents of the file to
1257 see if it has changed&#8201;&#8212;&#8201;it makes Git to omit any checking and
1258 assume it has <strong>not</strong> changed. When you make changes to working
1259 tree files, you have to explicitly tell Git about it by dropping
1260 "assume unchanged" bit, either before or after you modify them.</p></div>
1261 <div class="paragraph"><p>In order to set "assume unchanged" bit, use <code>--assume-unchanged</code>
1262 option. To unset, use <code>--no-assume-unchanged</code>. To see which files
1263 have the "assume unchanged" bit set, use <code>git ls-files -v</code>
1264 (see <a href="git-ls-files.html">git-ls-files(1)</a>).</p></div>
1265 <div class="paragraph"><p>The command looks at <code>core.ignorestat</code> configuration variable. When
1266 this is true, paths updated with <code>git update-index paths...</code> and
1267 paths updated with other Git commands that update both index and
1268 working tree (e.g. <em>git apply --index</em>, <em>git checkout-index -u</em>,
1269 and <em>git read-tree -u</em>) are automatically marked as "assume
1270 unchanged". Note that "assume unchanged" bit is <strong>not</strong> set if
1271 <code>git update-index --refresh</code> finds the working tree file matches
1272 the index (use <code>git update-index --really-refresh</code> if you want
1273 to mark them as "assume unchanged").</p></div>
1274 <div class="paragraph"><p>Sometimes users confuse the assume-unchanged bit with the
1275 skip-worktree bit. See the final paragraph in the "Skip-worktree bit"
1276 section below for an explanation of the differences.</p></div>
1277 </div>
1278 </div>
1279 <div class="sect1">
1280 <h2 id="_examples">EXAMPLES</h2>
1281 <div class="sectionbody">
1282 <div class="paragraph"><p>To update and refresh only the files already checked out:</p></div>
1283 <div class="listingblock">
1284 <div class="content">
1285 <pre><code>$ git checkout-index -n -f -a &amp;&amp; git update-index --ignore-missing --refresh</code></pre>
1286 </div></div>
1287 <div class="dlist"><dl>
1288 <dt class="hdlist1">
1289 On an inefficient filesystem with <code>core.ignorestat</code> set
1290 </dt>
1291 <dd>
1292 <div class="listingblock">
1293 <div class="content">
1294 <pre><code>$ git update-index --really-refresh <b>&lt;1&gt;</b>
1295 $ git update-index --no-assume-unchanged foo.c <b>&lt;2&gt;</b>
1296 $ git diff --name-only <b>&lt;3&gt;</b>
1297 $ edit foo.c
1298 $ git diff --name-only <b>&lt;4&gt;</b>
1299 M foo.c
1300 $ git update-index foo.c <b>&lt;5&gt;</b>
1301 $ git diff --name-only <b>&lt;6&gt;</b>
1302 $ edit foo.c
1303 $ git diff --name-only <b>&lt;7&gt;</b>
1304 $ git update-index --no-assume-unchanged foo.c <b>&lt;8&gt;</b>
1305 $ git diff --name-only <b>&lt;9&gt;</b>
1306 M foo.c</code></pre>
1307 </div></div>
1308 <div class="colist arabic"><ol>
1309 <li>
1311 forces lstat(2) to set "assume unchanged" bits for paths that match index.
1312 </p>
1313 </li>
1314 <li>
1316 mark the path to be edited.
1317 </p>
1318 </li>
1319 <li>
1321 this does lstat(2) and finds index matches the path.
1322 </p>
1323 </li>
1324 <li>
1326 this does lstat(2) and finds index does <strong>not</strong> match the path.
1327 </p>
1328 </li>
1329 <li>
1331 registering the new version to index sets "assume unchanged" bit.
1332 </p>
1333 </li>
1334 <li>
1336 and it is assumed unchanged.
1337 </p>
1338 </li>
1339 <li>
1341 even after you edit it.
1342 </p>
1343 </li>
1344 <li>
1346 you can tell about the change after the fact.
1347 </p>
1348 </li>
1349 <li>
1351 now it checks with lstat(2) and finds it has been changed.
1352 </p>
1353 </li>
1354 </ol></div>
1355 </dd>
1356 </dl></div>
1357 </div>
1358 </div>
1359 <div class="sect1">
1360 <h2 id="_skip_worktree_bit">SKIP-WORKTREE BIT</h2>
1361 <div class="sectionbody">
1362 <div class="paragraph"><p>Skip-worktree bit can be defined in one (long) sentence: Tell git to
1363 avoid writing the file to the working directory when reasonably
1364 possible, and treat the file as unchanged when it is not
1365 present in the working directory.</p></div>
1366 <div class="paragraph"><p>Note that not all git commands will pay attention to this bit, and
1367 some only partially support it.</p></div>
1368 <div class="paragraph"><p>The update-index flags and the read-tree capabilities relating to the
1369 skip-worktree bit predated the introduction of the
1370 <a href="git-sparse-checkout.html">git-sparse-checkout(1)</a> command, which provides a much easier
1371 way to configure and handle the skip-worktree bits. If you want to
1372 reduce your working tree to only deal with a subset of the files in
1373 the repository, we strongly encourage the use of
1374 <a href="git-sparse-checkout.html">git-sparse-checkout(1)</a> in preference to the low-level
1375 update-index and read-tree primitives.</p></div>
1376 <div class="paragraph"><p>The primary purpose of the skip-worktree bit is to enable sparse
1377 checkouts, i.e. to have working directories with only a subset of
1378 paths present. When the skip-worktree bit is set, Git commands (such
1379 as <code>switch</code>, <code>pull</code>, <code>merge</code>) will avoid writing these files.
1380 However, these commands will sometimes write these files anyway in
1381 important cases such as conflicts during a merge or rebase. Git
1382 commands will also avoid treating the lack of such files as an
1383 intentional deletion; for example <code>git add -u</code> will not stage a
1384 deletion for these files and <code>git commit -a</code> will not make a commit
1385 deleting them either.</p></div>
1386 <div class="paragraph"><p>Although this bit looks similar to assume-unchanged bit, its goal is
1387 different. The assume-unchanged bit is for leaving the file in the
1388 working tree but having Git omit checking it for changes and presuming
1389 that the file has not been changed (though if it can determine without
1390 stat&#8217;ing the file that it has changed, it is free to record the
1391 changes). skip-worktree tells Git to ignore the absence of the file,
1392 avoid updating it when possible with commands that normally update
1393 much of the working directory (e.g. <code>checkout</code>, <code>switch</code>, <code>pull</code>,
1394 etc.), and not have its absence be recorded in commits. Note that in
1395 sparse checkouts (setup by <code>git sparse-checkout</code> or by configuring
1396 core.sparseCheckout to true), if a file is marked as skip-worktree in
1397 the index but is found in the working tree, Git will clear the
1398 skip-worktree bit for that file.</p></div>
1399 </div>
1400 </div>
1401 <div class="sect1">
1402 <h2 id="_split_index">SPLIT INDEX</h2>
1403 <div class="sectionbody">
1404 <div class="paragraph"><p>This mode is designed for repositories with very large indexes, and
1405 aims at reducing the time it takes to repeatedly write these indexes.</p></div>
1406 <div class="paragraph"><p>In this mode, the index is split into two files, $GIT_DIR/index and
1407 $GIT_DIR/sharedindex.&lt;SHA-1&gt;. Changes are accumulated in
1408 $GIT_DIR/index, the split index, while the shared index file contains
1409 all index entries and stays unchanged.</p></div>
1410 <div class="paragraph"><p>All changes in the split index are pushed back to the shared index
1411 file when the number of entries in the split index reaches a level
1412 specified by the splitIndex.maxPercentChange config variable (see
1413 <a href="git-config.html">git-config(1)</a>).</p></div>
1414 <div class="paragraph"><p>Each time a new shared index file is created, the old shared index
1415 files are deleted if their modification time is older than what is
1416 specified by the splitIndex.sharedIndexExpire config variable (see
1417 <a href="git-config.html">git-config(1)</a>).</p></div>
1418 <div class="paragraph"><p>To avoid deleting a shared index file that is still used, its
1419 modification time is updated to the current time every time a new split
1420 index based on the shared index file is either created or read from.</p></div>
1421 </div>
1422 </div>
1423 <div class="sect1">
1424 <h2 id="_untracked_cache">UNTRACKED CACHE</h2>
1425 <div class="sectionbody">
1426 <div class="paragraph"><p>This cache is meant to speed up commands that involve determining
1427 untracked files such as <code>git status</code>.</p></div>
1428 <div class="paragraph"><p>This feature works by recording the mtime of the working tree
1429 directories and then omitting reading directories and stat calls
1430 against files in those directories whose mtime hasn&#8217;t changed. For
1431 this to work the underlying operating system and file system must
1432 change the <code>st_mtime</code> field of directories if files in the directory
1433 are added, modified or deleted.</p></div>
1434 <div class="paragraph"><p>You can test whether the filesystem supports that with the
1435 <code>--test-untracked-cache</code> option. The <code>--untracked-cache</code> option used
1436 to implicitly perform that test in older versions of Git, but that&#8217;s
1437 no longer the case.</p></div>
1438 <div class="paragraph"><p>If you want to enable (or disable) this feature, it is easier to use
1439 the <code>core.untrackedCache</code> configuration variable (see
1440 <a href="git-config.html">git-config(1)</a>) than using the <code>--untracked-cache</code> option to
1441 <code>git update-index</code> in each repository, especially if you want to do so
1442 across all repositories you use, because you can set the configuration
1443 variable to <code>true</code> (or <code>false</code>) in your <code>$HOME/.gitconfig</code> just once
1444 and have it affect all repositories you touch.</p></div>
1445 <div class="paragraph"><p>When the <code>core.untrackedCache</code> configuration variable is changed, the
1446 untracked cache is added to or removed from the index the next time a
1447 command reads the index; while when <code>--[no-|force-]untracked-cache</code>
1448 are used, the untracked cache is immediately added to or removed from
1449 the index.</p></div>
1450 <div class="paragraph"><p>Before 2.17, the untracked cache had a bug where replacing a directory
1451 with a symlink to another directory could cause it to incorrectly show
1452 files tracked by git as untracked. See the "status: add a failing test
1453 showing a core.untrackedCache bug" commit to git.git. A workaround for
1454 that is (and this might work for other undiscovered bugs in the
1455 future):</p></div>
1456 <div class="listingblock">
1457 <div class="content">
1458 <pre><code>$ git -c core.untrackedCache=false status</code></pre>
1459 </div></div>
1460 <div class="paragraph"><p>This bug has also been shown to affect non-symlink cases of replacing
1461 a directory with a file when it comes to the internal structures of
1462 the untracked cache, but no case has been reported where this resulted in
1463 wrong "git status" output.</p></div>
1464 <div class="paragraph"><p>There are also cases where existing indexes written by git versions
1465 before 2.17 will reference directories that don&#8217;t exist anymore,
1466 potentially causing many "could not open directory" warnings to be
1467 printed on "git status". These are new warnings for existing issues
1468 that were previously silently discarded.</p></div>
1469 <div class="paragraph"><p>As with the bug described above the solution is to one-off do a "git
1470 status" run with <code>core.untrackedCache=false</code> to flush out the leftover
1471 bad data.</p></div>
1472 </div>
1473 </div>
1474 <div class="sect1">
1475 <h2 id="_file_system_monitor">FILE SYSTEM MONITOR</h2>
1476 <div class="sectionbody">
1477 <div class="paragraph"><p>This feature is intended to speed up git operations for repos that have
1478 large working directories.</p></div>
1479 <div class="paragraph"><p>It enables git to work together with a file system monitor (see
1480 <a href="git-fsmonitor&#45;&#45;daemon.html">git-fsmonitor&#45;&#45;daemon(1)</a>
1481 and the
1482 "fsmonitor-watchman" section of <a href="githooks.html">githooks(5)</a>) that can
1483 inform it as to what files have been modified. This enables git to avoid
1484 having to lstat() every file to find modified files.</p></div>
1485 <div class="paragraph"><p>When used in conjunction with the untracked cache, it can further improve
1486 performance by avoiding the cost of scanning the entire working directory
1487 looking for new files.</p></div>
1488 <div class="paragraph"><p>If you want to enable (or disable) this feature, it is easier to use
1489 the <code>core.fsmonitor</code> configuration variable (see
1490 <a href="git-config.html">git-config(1)</a>) than using the <code>--fsmonitor</code> option to <code>git
1491 update-index</code> in each repository, especially if you want to do so
1492 across all repositories you use, because you can set the configuration
1493 variable in your <code>$HOME/.gitconfig</code> just once and have it affect all
1494 repositories you touch.</p></div>
1495 <div class="paragraph"><p>When the <code>core.fsmonitor</code> configuration variable is changed, the
1496 file system monitor is added to or removed from the index the next time
1497 a command reads the index. When <code>--[no-]fsmonitor</code> are used, the file
1498 system monitor is immediately added to or removed from the index.</p></div>
1499 </div>
1500 </div>
1501 <div class="sect1">
1502 <h2 id="_configuration">CONFIGURATION</h2>
1503 <div class="sectionbody">
1504 <div class="paragraph"><p>The command honors <code>core.filemode</code> configuration variable. If
1505 your repository is on a filesystem whose executable bits are
1506 unreliable, this should be set to <em>false</em> (see <a href="git-config.html">git-config(1)</a>).
1507 This causes the command to ignore differences in file modes recorded
1508 in the index and the file mode on the filesystem if they differ only on
1509 executable bit. On such an unfortunate filesystem, you may
1510 need to use <em>git update-index --chmod=</em>.</p></div>
1511 <div class="paragraph"><p>Quite similarly, if <code>core.symlinks</code> configuration variable is set
1512 to <em>false</em> (see <a href="git-config.html">git-config(1)</a>), symbolic links are checked out
1513 as plain files, and this command does not modify a recorded file mode
1514 from symbolic link to regular file.</p></div>
1515 <div class="paragraph"><p>The command looks at <code>core.ignorestat</code> configuration variable. See
1516 <em>Using "assume unchanged" bit</em> section above.</p></div>
1517 <div class="paragraph"><p>The command also looks at <code>core.trustctime</code> configuration variable.
1518 It can be useful when the inode change time is regularly modified by
1519 something outside Git (file system crawlers and backup systems use
1520 ctime for marking files processed) (see <a href="git-config.html">git-config(1)</a>).</p></div>
1521 <div class="paragraph"><p>The untracked cache extension can be enabled by the
1522 <code>core.untrackedCache</code> configuration variable (see
1523 <a href="git-config.html">git-config(1)</a>).</p></div>
1524 </div>
1525 </div>
1526 <div class="sect1">
1527 <h2 id="_notes">NOTES</h2>
1528 <div class="sectionbody">
1529 <div class="paragraph"><p>Users often try to use the assume-unchanged and skip-worktree bits
1530 to tell Git to ignore changes to files that are tracked. This does not
1531 work as expected, since Git may still check working tree files against
1532 the index when performing certain operations. In general, Git does not
1533 provide a way to ignore changes to tracked files, so alternate solutions
1534 are recommended.</p></div>
1535 <div class="paragraph"><p>For example, if the file you want to change is some sort of config file,
1536 the repository can include a sample config file that can then be copied
1537 into the ignored name and modified. The repository can even include a
1538 script to treat the sample file as a template, modifying and copying it
1539 automatically.</p></div>
1540 </div>
1541 </div>
1542 <div class="sect1">
1543 <h2 id="_see_also">SEE ALSO</h2>
1544 <div class="sectionbody">
1545 <div class="paragraph"><p><a href="git-config.html">git-config(1)</a>,
1546 <a href="git-add.html">git-add(1)</a>,
1547 <a href="git-ls-files.html">git-ls-files(1)</a></p></div>
1548 </div>
1549 </div>
1550 <div class="sect1">
1551 <h2 id="_git">GIT</h2>
1552 <div class="sectionbody">
1553 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
1554 </div>
1555 </div>
1556 </div>
1557 <div id="footnotes"><hr /></div>
1558 <div id="footer">
1559 <div id="footer-text">
1560 Last updated
1561 2024-05-23 12:14:58 PDT
1562 </div>
1563 </div>
1564 </body>
1565 </html>