Autogenerated HTML docs for v2.44.0-616-g548fe3
[git-htmldocs.git] / git-update-index.html
blob07d2ca98c546093b9a651b2f226606223eb49240
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 [--verbose]
769 [--] [&lt;file&gt;&#8230;]</pre>
770 <div class="attribution">
771 </div></div>
772 </div>
773 </div>
774 <div class="sect1">
775 <h2 id="_description">DESCRIPTION</h2>
776 <div class="sectionbody">
777 <div class="paragraph"><p>Modifies the index. Each file mentioned is updated into the index and
778 any <em>unmerged</em> or <em>needs updating</em> state is 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>
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>
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 files.
807 </p>
808 </dd>
809 <dt class="hdlist1">
810 --refresh
811 </dt>
812 <dd>
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">
820 </dt>
821 <dd>
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>
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>
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>
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>
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>
874 Read index information from stdin.
875 </p>
876 </dd>
877 <dt class="hdlist1">
878 --chmod=(+|-)x
879 </dt>
880 <dd>
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>
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 a 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>
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>
921 When one of these flags is specified, the object names 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-]ignore-skip-worktree-entries
929 </dt>
930 <dd>
932 Do not remove skip-worktree (AKA "index-only") entries even when
933 the <code>--remove</code> option was specified.
934 </p>
935 </dd>
936 <dt class="hdlist1">
937 --[no-]fsmonitor-valid
938 </dt>
939 <dd>
941 When one of these flags is specified, the object names recorded
942 for the paths are not updated. Instead, these options
943 set and unset the "fsmonitor valid" bit for the paths. See
944 section "File System Monitor" below for more information.
945 </p>
946 </dd>
947 <dt class="hdlist1">
949 </dt>
950 <dt class="hdlist1">
951 --again
952 </dt>
953 <dd>
955 Runs <em>git update-index</em> itself on the paths whose index
956 entries are different from those of the <code>HEAD</code> commit.
957 </p>
958 </dd>
959 <dt class="hdlist1">
960 --unresolve
961 </dt>
962 <dd>
964 Restores the <em>unmerged</em> or <em>needs updating</em> state of a
965 file during a merge if it was cleared by accident.
966 </p>
967 </dd>
968 <dt class="hdlist1">
969 --info-only
970 </dt>
971 <dd>
973 Do not create objects in the object database for all
974 &lt;file&gt; arguments that follow this flag; just insert
975 their object IDs into the index.
976 </p>
977 </dd>
978 <dt class="hdlist1">
979 --force-remove
980 </dt>
981 <dd>
983 Remove the file from the index even when the working directory
984 still has such a file. (Implies --remove.)
985 </p>
986 </dd>
987 <dt class="hdlist1">
988 --replace
989 </dt>
990 <dd>
992 By default, when a file <code>path</code> exists in the index,
993 <em>git update-index</em> refuses an attempt to add <code>path/file</code>.
994 Similarly if a file <code>path/file</code> exists, a file <code>path</code>
995 cannot be added. With --replace flag, existing entries
996 that conflict with the entry being added are
997 automatically removed with warning messages.
998 </p>
999 </dd>
1000 <dt class="hdlist1">
1001 --stdin
1002 </dt>
1003 <dd>
1005 Instead of taking a list of paths from the command line,
1006 read a list of paths from the standard input. Paths are
1007 separated by LF (i.e. one path per line) by default.
1008 </p>
1009 </dd>
1010 <dt class="hdlist1">
1011 --verbose
1012 </dt>
1013 <dd>
1015 Report what is being added and removed from the index.
1016 </p>
1017 </dd>
1018 <dt class="hdlist1">
1019 --index-version &lt;n&gt;
1020 </dt>
1021 <dd>
1023 Write the resulting index out in the named on-disk format version.
1024 Supported versions are 2, 3, and 4. The current default version is 2
1025 or 3, depending on whether extra features are used, such as
1026 <code>git add -N</code>. With <code>--verbose</code>, also report the version the index
1027 file uses before and after this command.
1028 </p>
1029 <div class="paragraph"><p>Version 4 performs a simple pathname compression that reduces index
1030 size by 30%-50% on large repositories, which results in faster load
1031 time. Git supports it since version 1.8.0, released in October 2012,
1032 and support for it was added to libgit2 in 2016 and to JGit in 2020.
1033 Older versions of this manual page called it "relatively young", but
1034 it should be considered mature technology these days.</p></div>
1035 </dd>
1036 <dt class="hdlist1">
1037 --show-index-version
1038 </dt>
1039 <dd>
1041 Report the index format version used by the on-disk index file.
1042 See <code>--index-version</code> above.
1043 </p>
1044 </dd>
1045 <dt class="hdlist1">
1047 </dt>
1048 <dd>
1050 Only meaningful with <code>--stdin</code> or <code>--index-info</code>; paths are
1051 separated with NUL character instead of LF.
1052 </p>
1053 </dd>
1054 <dt class="hdlist1">
1055 --split-index
1056 </dt>
1057 <dt class="hdlist1">
1058 --no-split-index
1059 </dt>
1060 <dd>
1062 Enable or disable split index mode. If split-index mode is
1063 already enabled and <code>--split-index</code> is given again, all
1064 changes in $GIT_DIR/index are pushed back to the shared index
1065 file.
1066 </p>
1067 <div class="paragraph"><p>These options take effect whatever the value of the <code>core.splitIndex</code>
1068 configuration variable (see <a href="git-config.html">git-config(1)</a>). But a warning is
1069 emitted when the change goes against the configured value, as the
1070 configured value will take effect next time the index is read and this
1071 will remove the intended effect of the option.</p></div>
1072 </dd>
1073 <dt class="hdlist1">
1074 --untracked-cache
1075 </dt>
1076 <dt class="hdlist1">
1077 --no-untracked-cache
1078 </dt>
1079 <dd>
1081 Enable or disable untracked cache feature. Please use
1082 <code>--test-untracked-cache</code> before enabling it.
1083 </p>
1084 <div class="paragraph"><p>These options take effect whatever the value of the <code>core.untrackedCache</code>
1085 configuration variable (see <a href="git-config.html">git-config(1)</a>). But a warning is
1086 emitted when the change goes against the configured value, as the
1087 configured value will take effect next time the index is read and this
1088 will remove the intended effect of the option.</p></div>
1089 </dd>
1090 <dt class="hdlist1">
1091 --test-untracked-cache
1092 </dt>
1093 <dd>
1095 Only perform tests on the working directory to make sure
1096 untracked cache can be used. You have to manually enable
1097 untracked cache using <code>--untracked-cache</code> or
1098 <code>--force-untracked-cache</code> or the <code>core.untrackedCache</code>
1099 configuration variable afterwards if you really want to use
1100 it. If a test fails the exit code is 1 and a message
1101 explains what is not working as needed, otherwise the exit
1102 code is 0 and OK is printed.
1103 </p>
1104 </dd>
1105 <dt class="hdlist1">
1106 --force-untracked-cache
1107 </dt>
1108 <dd>
1110 Same as <code>--untracked-cache</code>. Provided for backwards
1111 compatibility with older versions of Git where
1112 <code>--untracked-cache</code> used to imply <code>--test-untracked-cache</code> but
1113 this option would enable the extension unconditionally.
1114 </p>
1115 </dd>
1116 <dt class="hdlist1">
1117 --fsmonitor
1118 </dt>
1119 <dt class="hdlist1">
1120 --no-fsmonitor
1121 </dt>
1122 <dd>
1124 Enable or disable files system monitor feature. These options
1125 take effect whatever the value of the <code>core.fsmonitor</code>
1126 configuration variable (see <a href="git-config.html">git-config(1)</a>). But a warning
1127 is emitted when the change goes against the configured value, as
1128 the configured value will take effect next time the index is
1129 read and this will remove the intended effect of the option.
1130 </p>
1131 </dd>
1132 <dt class="hdlist1">
1134 </dt>
1135 <dd>
1137 Do not interpret any more arguments as options.
1138 </p>
1139 </dd>
1140 <dt class="hdlist1">
1141 &lt;file&gt;
1142 </dt>
1143 <dd>
1145 Files to act on.
1146 Note that files beginning with <em>.</em> are discarded. This includes
1147 <code>./file</code> and <code>dir/./file</code>. If you don&#8217;t want this, then use
1148 cleaner names.
1149 The same applies to directories ending <em>/</em> and paths with <em>//</em>
1150 </p>
1151 </dd>
1152 </dl></div>
1153 </div>
1154 </div>
1155 <div class="sect1">
1156 <h2 id="_using_refresh">USING --REFRESH</h2>
1157 <div class="sectionbody">
1158 <div class="paragraph"><p><code>--refresh</code> does not calculate a new sha1 file or bring the index
1159 up to date for mode/content changes. But what it <strong>does</strong> do is to
1160 "re-match" the stat information of a file with the index, so that you
1161 can refresh the index for a file that hasn&#8217;t been changed but where
1162 the stat entry is out of date.</p></div>
1163 <div class="paragraph"><p>For example, you&#8217;d want to do this after doing a <em>git read-tree</em>, to link
1164 up the stat index details with the proper files.</p></div>
1165 </div>
1166 </div>
1167 <div class="sect1">
1168 <h2 id="_using_cacheinfo_or_info_only">USING --CACHEINFO OR --INFO-ONLY</h2>
1169 <div class="sectionbody">
1170 <div class="paragraph"><p><code>--cacheinfo</code> is used to register a file that is not in the
1171 current working directory. This is useful for minimum-checkout
1172 merging.</p></div>
1173 <div class="paragraph"><p>To pretend you have a file at path with mode and sha1, say:</p></div>
1174 <div class="listingblock">
1175 <div class="content">
1176 <pre><code>$ git update-index --add --cacheinfo &lt;mode&gt;,&lt;sha1&gt;,&lt;path&gt;</code></pre>
1177 </div></div>
1178 <div class="paragraph"><p><code>--info-only</code> is used to register files without placing them in the object
1179 database. This is useful for status-only repositories.</p></div>
1180 <div class="paragraph"><p>Both <code>--cacheinfo</code> and <code>--info-only</code> behave similarly: the index is updated
1181 but the object database isn&#8217;t. <code>--cacheinfo</code> is useful when the object is
1182 in the database but the file isn&#8217;t available locally. <code>--info-only</code> is
1183 useful when the file is available, but you do not wish to update the
1184 object database.</p></div>
1185 </div>
1186 </div>
1187 <div class="sect1">
1188 <h2 id="_using_index_info">USING --INDEX-INFO</h2>
1189 <div class="sectionbody">
1190 <div class="paragraph"><p><code>--index-info</code> is a more powerful mechanism that lets you feed
1191 multiple entry definitions from the standard input, and designed
1192 specifically for scripts. It can take inputs of three formats:</p></div>
1193 <div class="olist arabic"><ol class="arabic">
1194 <li>
1196 mode SP type SP sha1 TAB path
1197 </p>
1198 <div class="paragraph"><p>This format is to stuff <code>git ls-tree</code> output into the index.</p></div>
1199 </li>
1200 <li>
1202 mode SP sha1 SP stage TAB path
1203 </p>
1204 <div class="paragraph"><p>This format is to put higher order stages into the
1205 index file and matches <em>git ls-files --stage</em> output.</p></div>
1206 </li>
1207 <li>
1209 mode SP sha1 TAB path
1210 </p>
1211 <div class="paragraph"><p>This format is no longer produced by any Git command, but is
1212 and will continue to be supported by <code>update-index --index-info</code>.</p></div>
1213 </li>
1214 </ol></div>
1215 <div class="paragraph"><p>To place a higher stage entry to the index, the path should
1216 first be removed by feeding a mode=0 entry for the path, and
1217 then feeding necessary input lines in the third format.</p></div>
1218 <div class="paragraph"><p>For example, starting with this index:</p></div>
1219 <div class="listingblock">
1220 <div class="content">
1221 <pre><code>$ git ls-files -s
1222 100644 8a1218a1024a212bb3db30becd860315f9f3ac52 0 frotz</code></pre>
1223 </div></div>
1224 <div class="paragraph"><p>you can feed the following input to <code>--index-info</code>:</p></div>
1225 <div class="listingblock">
1226 <div class="content">
1227 <pre><code>$ git update-index --index-info
1228 0 0000000000000000000000000000000000000000 frotz
1229 100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1 frotz
1230 100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2 frotz</code></pre>
1231 </div></div>
1232 <div class="paragraph"><p>The first line of the input feeds 0 as the mode to remove the
1233 path; the SHA-1 does not matter as long as it is well formatted.
1234 Then the second and third line feeds stage 1 and stage 2 entries
1235 for that path. After the above, we would end up with this:</p></div>
1236 <div class="listingblock">
1237 <div class="content">
1238 <pre><code>$ git ls-files -s
1239 100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1 frotz
1240 100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2 frotz</code></pre>
1241 </div></div>
1242 </div>
1243 </div>
1244 <div class="sect1">
1245 <h2 id="_using_8220_assume_unchanged_8221_bit">USING &#8220;ASSUME UNCHANGED&#8221; BIT</h2>
1246 <div class="sectionbody">
1247 <div class="paragraph"><p>Many operations in Git depend on your filesystem to have an
1248 efficient <code>lstat(2)</code> implementation, so that <code>st_mtime</code>
1249 information for working tree files can be cheaply checked to see
1250 if the file contents have changed from the version recorded in
1251 the index file. Unfortunately, some filesystems have
1252 inefficient <code>lstat(2)</code>. If your filesystem is one of them, you
1253 can set "assume unchanged" bit to paths you have not changed to
1254 cause Git not to do this check. Note that setting this bit on a
1255 path does not mean Git will check the contents of the file to
1256 see if it has changed&#8201;&#8212;&#8201;it makes Git to omit any checking and
1257 assume it has <strong>not</strong> changed. When you make changes to working
1258 tree files, you have to explicitly tell Git about it by dropping
1259 "assume unchanged" bit, either before or after you modify them.</p></div>
1260 <div class="paragraph"><p>In order to set "assume unchanged" bit, use <code>--assume-unchanged</code>
1261 option. To unset, use <code>--no-assume-unchanged</code>. To see which files
1262 have the "assume unchanged" bit set, use <code>git ls-files -v</code>
1263 (see <a href="git-ls-files.html">git-ls-files(1)</a>).</p></div>
1264 <div class="paragraph"><p>The command looks at <code>core.ignorestat</code> configuration variable. When
1265 this is true, paths updated with <code>git update-index paths...</code> and
1266 paths updated with other Git commands that update both index and
1267 working tree (e.g. <em>git apply --index</em>, <em>git checkout-index -u</em>,
1268 and <em>git read-tree -u</em>) are automatically marked as "assume
1269 unchanged". Note that "assume unchanged" bit is <strong>not</strong> set if
1270 <code>git update-index --refresh</code> finds the working tree file matches
1271 the index (use <code>git update-index --really-refresh</code> if you want
1272 to mark them as "assume unchanged").</p></div>
1273 <div class="paragraph"><p>Sometimes users confuse the assume-unchanged bit with the
1274 skip-worktree bit. See the final paragraph in the "Skip-worktree bit"
1275 section below for an explanation of the differences.</p></div>
1276 </div>
1277 </div>
1278 <div class="sect1">
1279 <h2 id="_examples">EXAMPLES</h2>
1280 <div class="sectionbody">
1281 <div class="paragraph"><p>To update and refresh only the files already checked out:</p></div>
1282 <div class="listingblock">
1283 <div class="content">
1284 <pre><code>$ git checkout-index -n -f -a &amp;&amp; git update-index --ignore-missing --refresh</code></pre>
1285 </div></div>
1286 <div class="dlist"><dl>
1287 <dt class="hdlist1">
1288 On an inefficient filesystem with <code>core.ignorestat</code> set
1289 </dt>
1290 <dd>
1291 <div class="listingblock">
1292 <div class="content">
1293 <pre><code>$ git update-index --really-refresh <b>&lt;1&gt;</b>
1294 $ git update-index --no-assume-unchanged foo.c <b>&lt;2&gt;</b>
1295 $ git diff --name-only <b>&lt;3&gt;</b>
1296 $ edit foo.c
1297 $ git diff --name-only <b>&lt;4&gt;</b>
1298 M foo.c
1299 $ git update-index foo.c <b>&lt;5&gt;</b>
1300 $ git diff --name-only <b>&lt;6&gt;</b>
1301 $ edit foo.c
1302 $ git diff --name-only <b>&lt;7&gt;</b>
1303 $ git update-index --no-assume-unchanged foo.c <b>&lt;8&gt;</b>
1304 $ git diff --name-only <b>&lt;9&gt;</b>
1305 M foo.c</code></pre>
1306 </div></div>
1307 <div class="colist arabic"><ol>
1308 <li>
1310 forces lstat(2) to set "assume unchanged" bits for paths that match index.
1311 </p>
1312 </li>
1313 <li>
1315 mark the path to be edited.
1316 </p>
1317 </li>
1318 <li>
1320 this does lstat(2) and finds index matches the path.
1321 </p>
1322 </li>
1323 <li>
1325 this does lstat(2) and finds index does <strong>not</strong> match the path.
1326 </p>
1327 </li>
1328 <li>
1330 registering the new version to index sets "assume unchanged" bit.
1331 </p>
1332 </li>
1333 <li>
1335 and it is assumed unchanged.
1336 </p>
1337 </li>
1338 <li>
1340 even after you edit it.
1341 </p>
1342 </li>
1343 <li>
1345 you can tell about the change after the fact.
1346 </p>
1347 </li>
1348 <li>
1350 now it checks with lstat(2) and finds it has been changed.
1351 </p>
1352 </li>
1353 </ol></div>
1354 </dd>
1355 </dl></div>
1356 </div>
1357 </div>
1358 <div class="sect1">
1359 <h2 id="_skip_worktree_bit">SKIP-WORKTREE BIT</h2>
1360 <div class="sectionbody">
1361 <div class="paragraph"><p>Skip-worktree bit can be defined in one (long) sentence: Tell git to
1362 avoid writing the file to the working directory when reasonably
1363 possible, and treat the file as unchanged when it is not
1364 present in the working directory.</p></div>
1365 <div class="paragraph"><p>Note that not all git commands will pay attention to this bit, and
1366 some only partially support it.</p></div>
1367 <div class="paragraph"><p>The update-index flags and the read-tree capabilities relating to the
1368 skip-worktree bit predated the introduction of the
1369 <a href="git-sparse-checkout.html">git-sparse-checkout(1)</a> command, which provides a much easier
1370 way to configure and handle the skip-worktree bits. If you want to
1371 reduce your working tree to only deal with a subset of the files in
1372 the repository, we strongly encourage the use of
1373 <a href="git-sparse-checkout.html">git-sparse-checkout(1)</a> in preference to the low-level
1374 update-index and read-tree primitives.</p></div>
1375 <div class="paragraph"><p>The primary purpose of the skip-worktree bit is to enable sparse
1376 checkouts, i.e. to have working directories with only a subset of
1377 paths present. When the skip-worktree bit is set, Git commands (such
1378 as <code>switch</code>, <code>pull</code>, <code>merge</code>) will avoid writing these files.
1379 However, these commands will sometimes write these files anyway in
1380 important cases such as conflicts during a merge or rebase. Git
1381 commands will also avoid treating the lack of such files as an
1382 intentional deletion; for example <code>git add -u</code> will not stage a
1383 deletion for these files and <code>git commit -a</code> will not make a commit
1384 deleting them either.</p></div>
1385 <div class="paragraph"><p>Although this bit looks similar to assume-unchanged bit, its goal is
1386 different. The assume-unchanged bit is for leaving the file in the
1387 working tree but having Git omit checking it for changes and presuming
1388 that the file has not been changed (though if it can determine without
1389 stat&#8217;ing the file that it has changed, it is free to record the
1390 changes). skip-worktree tells Git to ignore the absence of the file,
1391 avoid updating it when possible with commands that normally update
1392 much of the working directory (e.g. <code>checkout</code>, <code>switch</code>, <code>pull</code>,
1393 etc.), and not have its absence be recorded in commits. Note that in
1394 sparse checkouts (setup by <code>git sparse-checkout</code> or by configuring
1395 core.sparseCheckout to true), if a file is marked as skip-worktree in
1396 the index but is found in the working tree, Git will clear the
1397 skip-worktree bit for that file.</p></div>
1398 </div>
1399 </div>
1400 <div class="sect1">
1401 <h2 id="_split_index">SPLIT INDEX</h2>
1402 <div class="sectionbody">
1403 <div class="paragraph"><p>This mode is designed for repositories with very large indexes, and
1404 aims at reducing the time it takes to repeatedly write these indexes.</p></div>
1405 <div class="paragraph"><p>In this mode, the index is split into two files, $GIT_DIR/index and
1406 $GIT_DIR/sharedindex.&lt;SHA-1&gt;. Changes are accumulated in
1407 $GIT_DIR/index, the split index, while the shared index file contains
1408 all index entries and stays unchanged.</p></div>
1409 <div class="paragraph"><p>All changes in the split index are pushed back to the shared index
1410 file when the number of entries in the split index reaches a level
1411 specified by the splitIndex.maxPercentChange config variable (see
1412 <a href="git-config.html">git-config(1)</a>).</p></div>
1413 <div class="paragraph"><p>Each time a new shared index file is created, the old shared index
1414 files are deleted if their modification time is older than what is
1415 specified by the splitIndex.sharedIndexExpire config variable (see
1416 <a href="git-config.html">git-config(1)</a>).</p></div>
1417 <div class="paragraph"><p>To avoid deleting a shared index file that is still used, its
1418 modification time is updated to the current time every time a new split
1419 index based on the shared index file is either created or read from.</p></div>
1420 </div>
1421 </div>
1422 <div class="sect1">
1423 <h2 id="_untracked_cache">UNTRACKED CACHE</h2>
1424 <div class="sectionbody">
1425 <div class="paragraph"><p>This cache is meant to speed up commands that involve determining
1426 untracked files such as <code>git status</code>.</p></div>
1427 <div class="paragraph"><p>This feature works by recording the mtime of the working tree
1428 directories and then omitting reading directories and stat calls
1429 against files in those directories whose mtime hasn&#8217;t changed. For
1430 this to work the underlying operating system and file system must
1431 change the <code>st_mtime</code> field of directories if files in the directory
1432 are added, modified or deleted.</p></div>
1433 <div class="paragraph"><p>You can test whether the filesystem supports that with the
1434 <code>--test-untracked-cache</code> option. The <code>--untracked-cache</code> option used
1435 to implicitly perform that test in older versions of Git, but that&#8217;s
1436 no longer the case.</p></div>
1437 <div class="paragraph"><p>If you want to enable (or disable) this feature, it is easier to use
1438 the <code>core.untrackedCache</code> configuration variable (see
1439 <a href="git-config.html">git-config(1)</a>) than using the <code>--untracked-cache</code> option to
1440 <code>git update-index</code> in each repository, especially if you want to do so
1441 across all repositories you use, because you can set the configuration
1442 variable to <code>true</code> (or <code>false</code>) in your <code>$HOME/.gitconfig</code> just once
1443 and have it affect all repositories you touch.</p></div>
1444 <div class="paragraph"><p>When the <code>core.untrackedCache</code> configuration variable is changed, the
1445 untracked cache is added to or removed from the index the next time a
1446 command reads the index; while when <code>--[no-|force-]untracked-cache</code>
1447 are used, the untracked cache is immediately added to or removed from
1448 the index.</p></div>
1449 <div class="paragraph"><p>Before 2.17, the untracked cache had a bug where replacing a directory
1450 with a symlink to another directory could cause it to incorrectly show
1451 files tracked by git as untracked. See the "status: add a failing test
1452 showing a core.untrackedCache bug" commit to git.git. A workaround for
1453 that is (and this might work for other undiscovered bugs in the
1454 future):</p></div>
1455 <div class="listingblock">
1456 <div class="content">
1457 <pre><code>$ git -c core.untrackedCache=false status</code></pre>
1458 </div></div>
1459 <div class="paragraph"><p>This bug has also been shown to affect non-symlink cases of replacing
1460 a directory with a file when it comes to the internal structures of
1461 the untracked cache, but no case has been reported where this resulted in
1462 wrong "git status" output.</p></div>
1463 <div class="paragraph"><p>There are also cases where existing indexes written by git versions
1464 before 2.17 will reference directories that don&#8217;t exist anymore,
1465 potentially causing many "could not open directory" warnings to be
1466 printed on "git status". These are new warnings for existing issues
1467 that were previously silently discarded.</p></div>
1468 <div class="paragraph"><p>As with the bug described above the solution is to one-off do a "git
1469 status" run with <code>core.untrackedCache=false</code> to flush out the leftover
1470 bad data.</p></div>
1471 </div>
1472 </div>
1473 <div class="sect1">
1474 <h2 id="_file_system_monitor">FILE SYSTEM MONITOR</h2>
1475 <div class="sectionbody">
1476 <div class="paragraph"><p>This feature is intended to speed up git operations for repos that have
1477 large working directories.</p></div>
1478 <div class="paragraph"><p>It enables git to work together with a file system monitor (see
1479 <a href="git-fsmonitor&#45;&#45;daemon.html">git-fsmonitor&#45;&#45;daemon(1)</a>
1480 and the
1481 "fsmonitor-watchman" section of <a href="githooks.html">githooks(5)</a>) that can
1482 inform it as to what files have been modified. This enables git to avoid
1483 having to lstat() every file to find modified files.</p></div>
1484 <div class="paragraph"><p>When used in conjunction with the untracked cache, it can further improve
1485 performance by avoiding the cost of scanning the entire working directory
1486 looking for new files.</p></div>
1487 <div class="paragraph"><p>If you want to enable (or disable) this feature, it is easier to use
1488 the <code>core.fsmonitor</code> configuration variable (see
1489 <a href="git-config.html">git-config(1)</a>) than using the <code>--fsmonitor</code> option to <code>git
1490 update-index</code> in each repository, especially if you want to do so
1491 across all repositories you use, because you can set the configuration
1492 variable in your <code>$HOME/.gitconfig</code> just once and have it affect all
1493 repositories you touch.</p></div>
1494 <div class="paragraph"><p>When the <code>core.fsmonitor</code> configuration variable is changed, the
1495 file system monitor is added to or removed from the index the next time
1496 a command reads the index. When <code>--[no-]fsmonitor</code> are used, the file
1497 system monitor is immediately added to or removed from the index.</p></div>
1498 </div>
1499 </div>
1500 <div class="sect1">
1501 <h2 id="_configuration">CONFIGURATION</h2>
1502 <div class="sectionbody">
1503 <div class="paragraph"><p>The command honors <code>core.filemode</code> configuration variable. If
1504 your repository is on a filesystem whose executable bits are
1505 unreliable, this should be set to <em>false</em> (see <a href="git-config.html">git-config(1)</a>).
1506 This causes the command to ignore differences in file modes recorded
1507 in the index and the file mode on the filesystem if they differ only on
1508 executable bit. On such an unfortunate filesystem, you may
1509 need to use <em>git update-index --chmod=</em>.</p></div>
1510 <div class="paragraph"><p>Quite similarly, if <code>core.symlinks</code> configuration variable is set
1511 to <em>false</em> (see <a href="git-config.html">git-config(1)</a>), symbolic links are checked out
1512 as plain files, and this command does not modify a recorded file mode
1513 from symbolic link to regular file.</p></div>
1514 <div class="paragraph"><p>The command looks at <code>core.ignorestat</code> configuration variable. See
1515 <em>Using "assume unchanged" bit</em> section above.</p></div>
1516 <div class="paragraph"><p>The command also looks at <code>core.trustctime</code> configuration variable.
1517 It can be useful when the inode change time is regularly modified by
1518 something outside Git (file system crawlers and backup systems use
1519 ctime for marking files processed) (see <a href="git-config.html">git-config(1)</a>).</p></div>
1520 <div class="paragraph"><p>The untracked cache extension can be enabled by the
1521 <code>core.untrackedCache</code> configuration variable (see
1522 <a href="git-config.html">git-config(1)</a>).</p></div>
1523 </div>
1524 </div>
1525 <div class="sect1">
1526 <h2 id="_notes">NOTES</h2>
1527 <div class="sectionbody">
1528 <div class="paragraph"><p>Users often try to use the assume-unchanged and skip-worktree bits
1529 to tell Git to ignore changes to files that are tracked. This does not
1530 work as expected, since Git may still check working tree files against
1531 the index when performing certain operations. In general, Git does not
1532 provide a way to ignore changes to tracked files, so alternate solutions
1533 are recommended.</p></div>
1534 <div class="paragraph"><p>For example, if the file you want to change is some sort of config file,
1535 the repository can include a sample config file that can then be copied
1536 into the ignored name and modified. The repository can even include a
1537 script to treat the sample file as a template, modifying and copying it
1538 automatically.</p></div>
1539 </div>
1540 </div>
1541 <div class="sect1">
1542 <h2 id="_see_also">SEE ALSO</h2>
1543 <div class="sectionbody">
1544 <div class="paragraph"><p><a href="git-config.html">git-config(1)</a>,
1545 <a href="git-add.html">git-add(1)</a>,
1546 <a href="git-ls-files.html">git-ls-files(1)</a></p></div>
1547 </div>
1548 </div>
1549 <div class="sect1">
1550 <h2 id="_git">GIT</h2>
1551 <div class="sectionbody">
1552 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
1553 </div>
1554 </div>
1555 </div>
1556 <div id="footnotes"><hr /></div>
1557 <div id="footer">
1558 <div id="footer-text">
1559 Last updated
1560 2023-10-23 14:43:46 PDT
1561 </div>
1562 </div>
1563 </body>
1564 </html>