Autogenerated HTML docs for v1.7.4.1-176-g501cc
[git/jnareb-git.git] / git-update-index.html
blob377b9b359d91c803c79f76d5947f983070a7eb37
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <meta name="generator" content="AsciiDoc 8.4.5" />
7 <title>git-update-index(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.5em;
126 margin-bottom: 2.5em;
129 div.content { /* Block element content. */
130 padding: 0;
133 /* Block element titles. */
134 div.title, caption.title {
135 color: #527bbd;
136 font-family: sans-serif;
137 font-weight: bold;
138 text-align: left;
139 margin-top: 1.0em;
140 margin-bottom: 0.5em;
142 div.title + * {
143 margin-top: 0;
146 td div.title:first-child {
147 margin-top: 0.0em;
149 div.content div.title:first-child {
150 margin-top: 0.0em;
152 div.content + div.title {
153 margin-top: 0.0em;
156 div.sidebarblock > div.content {
157 background: #ffffee;
158 border: 1px solid silver;
159 padding: 0.5em;
162 div.listingblock > div.content {
163 border: 1px solid silver;
164 background: #f4f4f4;
165 padding: 0.5em;
168 div.quoteblock {
169 padding-left: 2.0em;
170 margin-right: 10%;
172 div.quoteblock > div.attribution {
173 padding-top: 0.5em;
174 text-align: right;
177 div.verseblock {
178 padding-left: 2.0em;
179 margin-right: 10%;
181 div.verseblock > div.content {
182 white-space: pre;
184 div.verseblock > div.attribution {
185 padding-top: 0.75em;
186 text-align: left;
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div.verseblock + div.attribution {
190 text-align: left;
193 div.admonitionblock .icon {
194 vertical-align: top;
195 font-size: 1.1em;
196 font-weight: bold;
197 text-decoration: underline;
198 color: #527bbd;
199 padding-right: 0.5em;
201 div.admonitionblock td.content {
202 padding-left: 0.5em;
203 border-left: 2px solid silver;
206 div.exampleblock > div.content {
207 border-left: 2px solid silver;
208 padding: 0.5em;
211 div.imageblock div.content { padding-left: 0; }
212 span.image img { border-style: none; }
213 a.image:visited { color: white; }
215 dl {
216 margin-top: 0.8em;
217 margin-bottom: 0.8em;
219 dt {
220 margin-top: 0.5em;
221 margin-bottom: 0;
222 font-style: normal;
223 color: navy;
225 dd > *:first-child {
226 margin-top: 0.1em;
229 ul, ol {
230 list-style-position: outside;
232 ol.arabic {
233 list-style-type: decimal;
235 ol.loweralpha {
236 list-style-type: lower-alpha;
238 ol.upperalpha {
239 list-style-type: upper-alpha;
241 ol.lowerroman {
242 list-style-type: lower-roman;
244 ol.upperroman {
245 list-style-type: upper-roman;
248 div.compact ul, div.compact ol,
249 div.compact p, div.compact p,
250 div.compact div, div.compact div {
251 margin-top: 0.1em;
252 margin-bottom: 0.1em;
255 div.tableblock > table {
256 border: 3px solid #527bbd;
258 thead {
259 font-family: sans-serif;
260 font-weight: bold;
262 tfoot {
263 font-weight: bold;
265 td > div.verse {
266 white-space: pre;
268 p.table {
269 margin-top: 0;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div.tableblock > table[frame="void"] {
273 border-style: none;
275 div.tableblock > table[frame="hsides"] {
276 border-left-style: none;
277 border-right-style: none;
279 div.tableblock > table[frame="vsides"] {
280 border-top-style: none;
281 border-bottom-style: none;
285 div.hdlist {
286 margin-top: 0.8em;
287 margin-bottom: 0.8em;
289 div.hdlist tr {
290 padding-bottom: 15px;
292 dt.hdlist1.strong, td.hdlist1.strong {
293 font-weight: bold;
295 td.hdlist1 {
296 vertical-align: top;
297 font-style: normal;
298 padding-right: 0.8em;
299 color: navy;
301 td.hdlist2 {
302 vertical-align: top;
304 div.hdlist.compact tr {
305 margin: 0;
306 padding-bottom: 0;
309 .comment {
310 background: yellow;
313 @media print {
314 div#footer-badges { display: none; }
317 div#toctitle {
318 color: #527bbd;
319 font-family: sans-serif;
320 font-size: 1.1em;
321 font-weight: bold;
322 margin-top: 1.0em;
323 margin-bottom: 0.1em;
326 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
327 margin-top: 0;
328 margin-bottom: 0;
330 div.toclevel2 {
331 margin-left: 2em;
332 font-size: 0.9em;
334 div.toclevel3 {
335 margin-left: 4em;
336 font-size: 0.9em;
338 div.toclevel4 {
339 margin-left: 6em;
340 font-size: 0.9em;
342 /* Overrides for manpage documents */
343 h1 {
344 padding-top: 0.5em;
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver;
347 border-bottom: 2px solid silver;
349 h2 {
350 border-style: none;
352 div.sectionbody {
353 margin-left: 5%;
356 @media print {
357 div#toc { display: none; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div.sidebar-content {
363 background: #ffffee;
364 border: 1px solid silver;
365 padding: 0.5em;
367 div.sidebar-title, div.image-title {
368 color: #527bbd;
369 font-family: sans-serif;
370 font-weight: bold;
371 margin-top: 0.0em;
372 margin-bottom: 0.5em;
375 div.listingblock div.content {
376 border: 1px solid silver;
377 background: #f4f4f4;
378 padding: 0.5em;
381 div.quoteblock-attribution {
382 padding-top: 0.5em;
383 text-align: right;
386 div.verseblock-content {
387 white-space: pre;
389 div.verseblock-attribution {
390 padding-top: 0.75em;
391 text-align: left;
394 div.exampleblock-content {
395 border-left: 2px solid silver;
396 padding-left: 0.5em;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc a:visited { color: blue; }
401 </style>
402 </head>
403 <body>
404 <div id="header">
405 <h1>
406 git-update-index(1) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>git-update-index -
411 Register file contents in the working tree to the index
412 </p>
413 </div>
414 </div>
415 <h2 id="_synopsis">SYNOPSIS</h2>
416 <div class="sectionbody">
417 <div class="verseblock">
418 <div class="verseblock-content"><em>git update-index</em>
419 [--add] [--remove | --force-remove] [--replace]
420 [--refresh] [-q] [--unmerged] [--ignore-missing]
421 [(--cacheinfo &lt;mode&gt; &lt;object&gt; &lt;file&gt;)&#8230;]
422 [--chmod=(+|-)x]
423 [--assume-unchanged | --no-assume-unchanged]
424 [--skip-worktree | --no-skip-worktree]
425 [--ignore-submodules]
426 [--really-refresh] [--unresolve] [--again | -g]
427 [--info-only] [--index-info]
428 [-z] [--stdin]
429 [--verbose]
430 [--] [&lt;file&gt;&#8230;]</div>
431 <div class="verseblock-attribution">
432 </div></div>
433 </div>
434 <h2 id="_description">DESCRIPTION</h2>
435 <div class="sectionbody">
436 <div class="paragraph"><p>Modifies the index or directory cache. Each file mentioned is updated
437 into the index and any <em>unmerged</em> or <em>needs updating</em> state is
438 cleared.</p></div>
439 <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
440 the most common operations on the index.</p></div>
441 <div class="paragraph"><p>The way <em>git update-index</em> handles files it is told about can be modified
442 using the various options:</p></div>
443 </div>
444 <h2 id="_options">OPTIONS</h2>
445 <div class="sectionbody">
446 <div class="dlist"><dl>
447 <dt class="hdlist1">
448 --add
449 </dt>
450 <dd>
452 If a specified file isn&#8217;t in the index already then it&#8217;s
453 added.
454 Default behaviour is to ignore new files.
455 </p>
456 </dd>
457 <dt class="hdlist1">
458 --remove
459 </dt>
460 <dd>
462 If a specified file is in the index but is missing then it&#8217;s
463 removed.
464 Default behavior is to ignore removed file.
465 </p>
466 </dd>
467 <dt class="hdlist1">
468 --refresh
469 </dt>
470 <dd>
472 Looks at the current index and checks to see if merges or
473 updates are needed by checking stat() information.
474 </p>
475 </dd>
476 <dt class="hdlist1">
478 </dt>
479 <dd>
481 Quiet. If --refresh finds that the index needs an update, the
482 default behavior is to error out. This option makes
483 <em>git update-index</em> continue anyway.
484 </p>
485 </dd>
486 <dt class="hdlist1">
487 --ignore-submodules
488 </dt>
489 <dd>
491 Do not try to update submodules. This option is only respected
492 when passed before --refresh.
493 </p>
494 </dd>
495 <dt class="hdlist1">
496 --unmerged
497 </dt>
498 <dd>
500 If --refresh finds unmerged changes in the index, the default
501 behavior is to error out. This option makes <em>git update-index</em>
502 continue anyway.
503 </p>
504 </dd>
505 <dt class="hdlist1">
506 --ignore-missing
507 </dt>
508 <dd>
510 Ignores missing files during a --refresh
511 </p>
512 </dd>
513 <dt class="hdlist1">
514 --cacheinfo &lt;mode&gt; &lt;object&gt; &lt;path&gt;
515 </dt>
516 <dd>
518 Directly insert the specified info into the index.
519 </p>
520 </dd>
521 <dt class="hdlist1">
522 --index-info
523 </dt>
524 <dd>
526 Read index information from stdin.
527 </p>
528 </dd>
529 <dt class="hdlist1">
530 --chmod=(+|-)x
531 </dt>
532 <dd>
534 Set the execute permissions on the updated files.
535 </p>
536 </dd>
537 <dt class="hdlist1">
538 --assume-unchanged
539 </dt>
540 <dt class="hdlist1">
541 --no-assume-unchanged
542 </dt>
543 <dd>
545 When these flags are specified, the object names recorded
546 for the paths are not updated. Instead, these options
547 set and unset the "assume unchanged" bit for the
548 paths. When the "assume unchanged" bit is on, git stops
549 checking the working tree files for possible
550 modifications, so you need to manually unset the bit to
551 tell git when you change the working tree file. This is
552 sometimes helpful when working with a big project on a
553 filesystem that has very slow lstat(2) system call
554 (e.g. cifs).
555 </p>
556 <div class="paragraph"><p>This option can be also used as a coarse file-level mechanism
557 to ignore uncommitted changes in tracked files (akin to what
558 <tt>.gitignore</tt> does for untracked files).
559 Git will fail (gracefully) in case it needs to modify this file
560 in the index e.g. when merging in a commit;
561 thus, in case the assumed-untracked file is changed upstream,
562 you will need to handle the situation manually.</p></div>
563 </dd>
564 <dt class="hdlist1">
565 --really-refresh
566 </dt>
567 <dd>
569 Like <em>--refresh</em>, but checks stat information unconditionally,
570 without regard to the "assume unchanged" setting.
571 </p>
572 </dd>
573 <dt class="hdlist1">
574 --skip-worktree
575 </dt>
576 <dt class="hdlist1">
577 --no-skip-worktree
578 </dt>
579 <dd>
581 When one of these flags is specified, the object name recorded
582 for the paths are not updated. Instead, these options
583 set and unset the "skip-worktree" bit for the paths. See
584 section "Skip-worktree bit" below for more information.
585 </p>
586 </dd>
587 <dt class="hdlist1">
589 </dt>
590 <dt class="hdlist1">
591 --again
592 </dt>
593 <dd>
595 Runs <em>git update-index</em> itself on the paths whose index
596 entries are different from those from the <tt>HEAD</tt> commit.
597 </p>
598 </dd>
599 <dt class="hdlist1">
600 --unresolve
601 </dt>
602 <dd>
604 Restores the <em>unmerged</em> or <em>needs updating</em> state of a
605 file during a merge if it was cleared by accident.
606 </p>
607 </dd>
608 <dt class="hdlist1">
609 --info-only
610 </dt>
611 <dd>
613 Do not create objects in the object database for all
614 &lt;file&gt; arguments that follow this flag; just insert
615 their object IDs into the index.
616 </p>
617 </dd>
618 <dt class="hdlist1">
619 --force-remove
620 </dt>
621 <dd>
623 Remove the file from the index even when the working directory
624 still has such a file. (Implies --remove.)
625 </p>
626 </dd>
627 <dt class="hdlist1">
628 --replace
629 </dt>
630 <dd>
632 By default, when a file <tt>path</tt> exists in the index,
633 <em>git update-index</em> refuses an attempt to add <tt>path/file</tt>.
634 Similarly if a file <tt>path/file</tt> exists, a file <tt>path</tt>
635 cannot be added. With --replace flag, existing entries
636 that conflict with the entry being added are
637 automatically removed with warning messages.
638 </p>
639 </dd>
640 <dt class="hdlist1">
641 --stdin
642 </dt>
643 <dd>
645 Instead of taking list of paths from the command line,
646 read list of paths from the standard input. Paths are
647 separated by LF (i.e. one path per line) by default.
648 </p>
649 </dd>
650 <dt class="hdlist1">
651 --verbose
652 </dt>
653 <dd>
655 Report what is being added and removed from index.
656 </p>
657 </dd>
658 <dt class="hdlist1">
660 </dt>
661 <dd>
663 Only meaningful with <tt>--stdin</tt> or <tt>--index-info</tt>; paths are
664 separated with NUL character instead of LF.
665 </p>
666 </dd>
667 <dt class="hdlist1">
669 </dt>
670 <dd>
672 Do not interpret any more arguments as options.
673 </p>
674 </dd>
675 <dt class="hdlist1">
676 &lt;file&gt;
677 </dt>
678 <dd>
680 Files to act on.
681 Note that files beginning with <em>.</em> are discarded. This includes
682 <tt>./file</tt> and <tt>dir/./file</tt>. If you don&#8217;t want this, then use
683 cleaner names.
684 The same applies to directories ending <em>/</em> and paths with <em>//</em>
685 </p>
686 </dd>
687 </dl></div>
688 </div>
689 <h2 id="_using_refresh">Using --refresh</h2>
690 <div class="sectionbody">
691 <div class="paragraph"><p><em>--refresh</em> does not calculate a new sha1 file or bring the index
692 up-to-date for mode/content changes. But what it <strong>does</strong> do is to
693 "re-match" the stat information of a file with the index, so that you
694 can refresh the index for a file that hasn&#8217;t been changed but where
695 the stat entry is out of date.</p></div>
696 <div class="paragraph"><p>For example, you&#8217;d want to do this after doing a <em>git read-tree</em>, to link
697 up the stat index details with the proper files.</p></div>
698 </div>
699 <h2 id="_using_cacheinfo_or_info_only">Using --cacheinfo or --info-only</h2>
700 <div class="sectionbody">
701 <div class="paragraph"><p><em>--cacheinfo</em> is used to register a file that is not in the
702 current working directory. This is useful for minimum-checkout
703 merging.</p></div>
704 <div class="paragraph"><p>To pretend you have a file with mode and sha1 at path, say:</p></div>
705 <div class="listingblock">
706 <div class="content">
707 <pre><tt>$ git update-index --cacheinfo mode sha1 path</tt></pre>
708 </div></div>
709 <div class="paragraph"><p><em>--info-only</em> is used to register files without placing them in the object
710 database. This is useful for status-only repositories.</p></div>
711 <div class="paragraph"><p>Both <em>--cacheinfo</em> and <em>--info-only</em> behave similarly: the index is updated
712 but the object database isn&#8217;t. <em>--cacheinfo</em> is useful when the object is
713 in the database but the file isn&#8217;t available locally. <em>--info-only</em> is
714 useful when the file is available, but you do not wish to update the
715 object database.</p></div>
716 </div>
717 <h2 id="_using_index_info">Using --index-info</h2>
718 <div class="sectionbody">
719 <div class="paragraph"><p><tt>--index-info</tt> is a more powerful mechanism that lets you feed
720 multiple entry definitions from the standard input, and designed
721 specifically for scripts. It can take inputs of three formats:</p></div>
722 <div class="olist arabic"><ol class="arabic">
723 <li>
725 mode SP sha1 TAB path
726 </p>
727 <div class="paragraph"><p>The first format is what "git-apply --index-info"
728 reports, and used to reconstruct a partial tree
729 that is used for phony merge base tree when falling
730 back on 3-way merge.</p></div>
731 </li>
732 <li>
734 mode SP type SP sha1 TAB path
735 </p>
736 <div class="paragraph"><p>The second format is to stuff <em>git ls-tree</em> output
737 into the index file.</p></div>
738 </li>
739 <li>
741 mode SP sha1 SP stage TAB path
742 </p>
743 <div class="paragraph"><p>This format is to put higher order stages into the
744 index file and matches <em>git ls-files --stage</em> output.</p></div>
745 </li>
746 </ol></div>
747 <div class="paragraph"><p>To place a higher stage entry to the index, the path should
748 first be removed by feeding a mode=0 entry for the path, and
749 then feeding necessary input lines in the third format.</p></div>
750 <div class="paragraph"><p>For example, starting with this index:</p></div>
751 <div class="listingblock">
752 <div class="content">
753 <pre><tt>$ git ls-files -s
754 100644 8a1218a1024a212bb3db30becd860315f9f3ac52 0 frotz</tt></pre>
755 </div></div>
756 <div class="paragraph"><p>you can feed the following input to <tt>--index-info</tt>:</p></div>
757 <div class="listingblock">
758 <div class="content">
759 <pre><tt>$ git update-index --index-info
760 0 0000000000000000000000000000000000000000 frotz
761 100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1 frotz
762 100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2 frotz</tt></pre>
763 </div></div>
764 <div class="paragraph"><p>The first line of the input feeds 0 as the mode to remove the
765 path; the SHA1 does not matter as long as it is well formatted.
766 Then the second and third line feeds stage 1 and stage 2 entries
767 for that path. After the above, we would end up with this:</p></div>
768 <div class="listingblock">
769 <div class="content">
770 <pre><tt>$ git ls-files -s
771 100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1 frotz
772 100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2 frotz</tt></pre>
773 </div></div>
774 </div>
775 <h2 id="_using_8220_assume_unchanged_8221_bit">Using &#8220;assume unchanged&#8221; bit</h2>
776 <div class="sectionbody">
777 <div class="paragraph"><p>Many operations in git depend on your filesystem to have an
778 efficient <tt>lstat(2)</tt> implementation, so that <tt>st_mtime</tt>
779 information for working tree files can be cheaply checked to see
780 if the file contents have changed from the version recorded in
781 the index file. Unfortunately, some filesystems have
782 inefficient <tt>lstat(2)</tt>. If your filesystem is one of them, you
783 can set "assume unchanged" bit to paths you have not changed to
784 cause git not to do this check. Note that setting this bit on a
785 path does not mean git will check the contents of the file to
786 see if it has changed&#8201;&#8212;&#8201;it makes git to omit any checking and
787 assume it has <strong>not</strong> changed. When you make changes to working
788 tree files, you have to explicitly tell git about it by dropping
789 "assume unchanged" bit, either before or after you modify them.</p></div>
790 <div class="paragraph"><p>In order to set "assume unchanged" bit, use <tt>--assume-unchanged</tt>
791 option. To unset, use <tt>--no-assume-unchanged</tt>.</p></div>
792 <div class="paragraph"><p>The command looks at <tt>core.ignorestat</tt> configuration variable. When
793 this is true, paths updated with <tt>git update-index paths&#8230;</tt> and
794 paths updated with other git commands that update both index and
795 working tree (e.g. <em>git apply --index</em>, <em>git checkout-index -u</em>,
796 and <em>git read-tree -u</em>) are automatically marked as "assume
797 unchanged". Note that "assume unchanged" bit is <strong>not</strong> set if
798 <tt>git update-index --refresh</tt> finds the working tree file matches
799 the index (use <tt>git update-index --really-refresh</tt> if you want
800 to mark them as "assume unchanged").</p></div>
801 </div>
802 <h2 id="_examples">Examples</h2>
803 <div class="sectionbody">
804 <div class="paragraph"><p>To update and refresh only the files already checked out:</p></div>
805 <div class="listingblock">
806 <div class="content">
807 <pre><tt>$ git checkout-index -n -f -a &amp;&amp; git update-index --ignore-missing --refresh</tt></pre>
808 </div></div>
809 <div class="dlist"><dl>
810 <dt class="hdlist1">
811 On an inefficient filesystem with <tt>core.ignorestat</tt> set
812 </dt>
813 <dd>
814 <div class="listingblock">
815 <div class="content">
816 <pre><tt>$ git update-index --really-refresh <b>&lt;1&gt;</b>
817 $ git update-index --no-assume-unchanged foo.c <b>&lt;2&gt;</b>
818 $ git diff --name-only <b>&lt;3&gt;</b>
819 $ edit foo.c
820 $ git diff --name-only <b>&lt;4&gt;</b>
821 M foo.c
822 $ git update-index foo.c <b>&lt;5&gt;</b>
823 $ git diff --name-only <b>&lt;6&gt;</b>
824 $ edit foo.c
825 $ git diff --name-only <b>&lt;7&gt;</b>
826 $ git update-index --no-assume-unchanged foo.c <b>&lt;8&gt;</b>
827 $ git diff --name-only <b>&lt;9&gt;</b>
828 M foo.c</tt></pre>
829 </div></div>
830 <div class="colist arabic"><ol>
831 <li>
833 forces lstat(2) to set "assume unchanged" bits for paths that match index.
834 </p>
835 </li>
836 <li>
838 mark the path to be edited.
839 </p>
840 </li>
841 <li>
843 this does lstat(2) and finds index matches the path.
844 </p>
845 </li>
846 <li>
848 this does lstat(2) and finds index does <strong>not</strong> match the path.
849 </p>
850 </li>
851 <li>
853 registering the new version to index sets "assume unchanged" bit.
854 </p>
855 </li>
856 <li>
858 and it is assumed unchanged.
859 </p>
860 </li>
861 <li>
863 even after you edit it.
864 </p>
865 </li>
866 <li>
868 you can tell about the change after the fact.
869 </p>
870 </li>
871 <li>
873 now it checks with lstat(2) and finds it has been changed.
874 </p>
875 </li>
876 </ol></div>
877 </dd>
878 </dl></div>
879 </div>
880 <h2 id="_skip_worktree_bit">Skip-worktree bit</h2>
881 <div class="sectionbody">
882 <div class="paragraph"><p>Skip-worktree bit can be defined in one (long) sentence: When reading
883 an entry, if it is marked as skip-worktree, then Git pretends its
884 working directory version is up to date and read the index version
885 instead.</p></div>
886 <div class="paragraph"><p>To elaborate, "reading" means checking for file existence, reading
887 file attributes or file content. The working directory version may be
888 present or absent. If present, its content may match against the index
889 version or not. Writing is not affected by this bit, content safety
890 is still first priority. Note that Git <em>can</em> update working directory
891 file, that is marked skip-worktree, if it is safe to do so (i.e.
892 working directory version matches index version)</p></div>
893 <div class="paragraph"><p>Although this bit looks similar to assume-unchanged bit, its goal is
894 different from assume-unchanged bit&#8217;s. Skip-worktree also takes
895 precedence over assume-unchanged bit when both are set.</p></div>
896 </div>
897 <h2 id="_configuration">Configuration</h2>
898 <div class="sectionbody">
899 <div class="paragraph"><p>The command honors <tt>core.filemode</tt> configuration variable. If
900 your repository is on a filesystem whose executable bits are
901 unreliable, this should be set to <em>false</em> (see <a href="git-config.html">git-config(1)</a>).
902 This causes the command to ignore differences in file modes recorded
903 in the index and the file mode on the filesystem if they differ only on
904 executable bit. On such an unfortunate filesystem, you may
905 need to use <em>git update-index --chmod=</em>.</p></div>
906 <div class="paragraph"><p>Quite similarly, if <tt>core.symlinks</tt> configuration variable is set
907 to <em>false</em> (see <a href="git-config.html">git-config(1)</a>), symbolic links are checked out
908 as plain files, and this command does not modify a recorded file mode
909 from symbolic link to regular file.</p></div>
910 <div class="paragraph"><p>The command looks at <tt>core.ignorestat</tt> configuration variable. See
911 <em>Using "assume unchanged" bit</em> section above.</p></div>
912 <div class="paragraph"><p>The command also looks at <tt>core.trustctime</tt> configuration variable.
913 It can be useful when the inode change time is regularly modified by
914 something outside Git (file system crawlers and backup systems use
915 ctime for marking files processed) (see <a href="git-config.html">git-config(1)</a>).</p></div>
916 </div>
917 <h2 id="_see_also">SEE ALSO</h2>
918 <div class="sectionbody">
919 <div class="paragraph"><p><a href="git-config.html">git-config(1)</a>,
920 <a href="git-add.html">git-add(1)</a></p></div>
921 </div>
922 <h2 id="_author">Author</h2>
923 <div class="sectionbody">
924 <div class="paragraph"><p>Written by Linus Torvalds &lt;<a href="mailto:torvalds@osdl.org">torvalds@osdl.org</a>&gt;</p></div>
925 </div>
926 <h2 id="_documentation">Documentation</h2>
927 <div class="sectionbody">
928 <div class="paragraph"><p>Documentation by David Greaves, Junio C Hamano and the git-list &lt;<a href="mailto:git@vger.kernel.org">git@vger.kernel.org</a>&gt;.</p></div>
929 </div>
930 <h2 id="_git">GIT</h2>
931 <div class="sectionbody">
932 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
933 </div>
934 <div id="footer">
935 <div id="footer-text">
936 Last updated 2010-11-06 00:41:57 UTC
937 </div>
938 </div>
939 </body>
940 </html>