]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-update-index.txt
The tenth batch
[thirdparty/git.git] / Documentation / git-update-index.txt
CommitLineData
215a7ad1 1git-update-index(1)
2cf565c5 2===================
2cf565c5
DG
3
4NAME
5----
c3f0baac 6git-update-index - Register file contents in the working tree to the index
2cf565c5
DG
7
8
9SYNOPSIS
10--------
f9666adf 11[verse]
b1889c36 12'git update-index'
de5f2bf3
MK
13 [--add] [--remove | --force-remove] [--replace]
14 [--refresh] [-q] [--unmerged] [--ignore-missing]
ec160ae1 15 [(--cacheinfo <mode>,<object>,<file>)...]
5773c9f2 16 [--chmod=(+|-)x]
0460ed2c
FC
17 [--[no-]assume-unchanged]
18 [--[no-]skip-worktree]
8dfb04ae 19 [--[no-]ignore-skip-worktree-entries]
780494b1 20 [--[no-]fsmonitor-valid]
5fdeacb0 21 [--ignore-submodules]
bc497127 22 [--[no-]split-index]
eaab83d0 23 [--[no-|test-|force-]untracked-cache]
780494b1 24 [--[no-]fsmonitor]
7099c9c7 25 [--really-refresh] [--unresolve] [--again | -g]
14470c0d 26 [--info-only] [--index-info]
69dec66b 27 [-z] [--stdin] [--index-version <n>]
c81ffcff 28 [--show-index-version]
14470c0d 29 [--verbose]
0adda936 30 [--] [<file>...]
2cf565c5
DG
31
32DESCRIPTION
33-----------
b356d236
UG
34Modifies the index. Each file mentioned is updated into the index and
35any 'unmerged' or 'needs updating' state is cleared.
2cf565c5 36
5162e697 37See also linkgit:git-add[1] for a more user-friendly way to do some of
e701ccc3
MM
38the most common operations on the index.
39
0b444cdb 40The way 'git update-index' handles files it is told about can be modified
2cf565c5
DG
41using the various options:
42
43OPTIONS
44-------
45--add::
5f3aa197 46 If a specified file isn't in the index already then it's
2cf565c5
DG
47 added.
48 Default behaviour is to ignore new files.
49
50--remove::
5f3aa197 51 If a specified file is in the index but is missing then it's
2cf565c5 52 removed.
6cc668c0 53 Default behavior is to ignore removed files.
2cf565c5
DG
54
55--refresh::
5f3aa197 56 Looks at the current index and checks to see if merges or
2cf565c5
DG
57 updates are needed by checking stat() information.
58
14470c0d 59-q::
5f3aa197 60 Quiet. If --refresh finds that the index needs an update, the
14470c0d 61 default behavior is to error out. This option makes
0b444cdb 62 'git update-index' continue anyway.
14470c0d 63
04c8ce9c 64--ignore-submodules::
5fdeacb0
JS
65 Do not try to update submodules. This option is only respected
66 when passed before --refresh.
67
14470c0d 68--unmerged::
5f3aa197 69 If --refresh finds unmerged changes in the index, the default
0b444cdb 70 behavior is to error out. This option makes 'git update-index'
14470c0d
CS
71 continue anyway.
72
2cf565c5
DG
73--ignore-missing::
74 Ignores missing files during a --refresh
75
ec160ae1 76--cacheinfo <mode>,<object>,<path>::
2cf565c5 77--cacheinfo <mode> <object> <path>::
ec160ae1
JH
78 Directly insert the specified info into the index. For
79 backward compatibility, you can also give these three
80 arguments as three separate parameters, but new users are
81 encouraged to use a single-parameter form.
a6080a0a 82
14470c0d 83--index-info::
7acab8f1 84 Read index information from stdin.
14470c0d
CS
85
86--chmod=(+|-)x::
a6080a0a 87 Set the execute permissions on the updated files.
14470c0d 88
0460ed2c 89--[no-]assume-unchanged::
ccadb25f
PO
90 When this flag is specified, the object names recorded
91 for the paths are not updated. Instead, this option
92 sets/unsets the "assume unchanged" bit for the
93 paths. When the "assume unchanged" bit is on, the user
94 promises not to change the file and allows Git to assume
95 that the working tree file matches what is recorded in
96 the index. If you want to change the working tree file,
97 you need to unset the bit to tell Git. This is
f9666adf 98 sometimes helpful when working with a big project on a
0a4f051f 99 filesystem that has a very slow lstat(2) system call
f9666adf 100 (e.g. cifs).
6259ac66 101+
6259ac66
PB
102Git will fail (gracefully) in case it needs to modify this file
103in the index e.g. when merging in a commit;
104thus, in case the assumed-untracked file is changed upstream,
105you will need to handle the situation manually.
f9666adf 106
466d1f15 107--really-refresh::
bcf9626a 108 Like `--refresh`, but checks stat information unconditionally,
466d1f15
ŠN
109 without regard to the "assume unchanged" setting.
110
0460ed2c 111--[no-]skip-worktree::
6cc668c0 112 When one of these flags is specified, the object names recorded
44a36913
NTND
113 for the paths are not updated. Instead, these options
114 set and unset the "skip-worktree" bit for the paths. See
115 section "Skip-worktree bit" below for more information.
116
8dfb04ae
JS
117
118--[no-]ignore-skip-worktree-entries::
119 Do not remove skip-worktree (AKA "index-only") entries even when
120 the `--remove` option was specified.
121
780494b1 122--[no-]fsmonitor-valid::
6cc668c0 123 When one of these flags is specified, the object names recorded
780494b1
BP
124 for the paths are not updated. Instead, these options
125 set and unset the "fsmonitor valid" bit for the paths. See
126 section "File System Monitor" below for more information.
127
3240240f
SB
128-g::
129--again::
0b444cdb 130 Runs 'git update-index' itself on the paths whose index
9a9fd289 131 entries are different from those of the `HEAD` commit.
83e77a25 132
060729dd
MK
133--unresolve::
134 Restores the 'unmerged' or 'needs updating' state of a
135 file during a merge if it was cleared by accident.
136
df6e1516
BL
137--info-only::
138 Do not create objects in the object database for all
139 <file> arguments that follow this flag; just insert
5f3aa197 140 their object IDs into the index.
df6e1516 141
2cf565c5
DG
142--force-remove::
143 Remove the file from the index even when the working directory
9b63f501 144 still has such a file. (Implies --remove.)
2cf565c5
DG
145
146--replace::
147 By default, when a file `path` exists in the index,
0b444cdb 148 'git update-index' refuses an attempt to add `path/file`.
2cf565c5
DG
149 Similarly if a file `path/file` exists, a file `path`
150 cannot be added. With --replace flag, existing entries
04c8ce9c 151 that conflict with the entry being added are
2cf565c5
DG
152 automatically removed with warning messages.
153
1f7f99de 154--stdin::
0a4f051f
EN
155 Instead of taking a list of paths from the command line,
156 read a list of paths from the standard input. Paths are
1f7f99de
JH
157 separated by LF (i.e. one path per line) by default.
158
14470c0d 159--verbose::
0a4f051f 160 Report what is being added and removed from the index.
14470c0d 161
69dec66b
JH
162--index-version <n>::
163 Write the resulting index out in the named on-disk format version.
4d542687 164 Supported versions are 2, 3, and 4. The current default version is 2
647d8794 165 or 3, depending on whether extra features are used, such as
606e088d
JH
166 `git add -N`. With `--verbose`, also report the version the index
167 file uses before and after this command.
647d8794
NTND
168+
169Version 4 performs a simple pathname compression that reduces index
170size by 30%-50% on large repositories, which results in faster load
764b2330
JH
171time. Git supports it since version 1.8.0, released in October 2012,
172and support for it was added to libgit2 in 2016 and to JGit in 2020.
173Older versions of this manual page called it "relatively young", but
174it should be considered mature technology these days.
175
606e088d
JH
176--show-index-version::
177 Report the index format version used by the on-disk index file.
178 See `--index-version` above.
69dec66b 179
1f7f99de 180-z::
537497be
BW
181 Only meaningful with `--stdin` or `--index-info`; paths are
182 separated with NUL character instead of LF.
1f7f99de 183
c18b80a0
NTND
184--split-index::
185--no-split-index::
b4601395
CC
186 Enable or disable split index mode. If split-index mode is
187 already enabled and `--split-index` is given again, all
188 changes in $GIT_DIR/index are pushed back to the shared index
189 file.
13c0e4c4
CC
190+
191These options take effect whatever the value of the `core.splitIndex`
192configuration variable (see linkgit:git-config[1]). But a warning is
193emitted when the change goes against the configured value, as the
194configured value will take effect next time the index is read and this
195will remove the intended effect of the option.
c18b80a0 196
9e597241
NTND
197--untracked-cache::
198--no-untracked-cache::
435ec090
CC
199 Enable or disable untracked cache feature. Please use
200 `--test-untracked-cache` before enabling it.
201+
202These options take effect whatever the value of the `core.untrackedCache`
203configuration variable (see linkgit:git-config[1]). But a warning is
204emitted when the change goes against the configured value, as the
205configured value will take effect next time the index is read and this
206will remove the intended effect of the option.
9e597241 207
eaab83d0
CC
208--test-untracked-cache::
209 Only perform tests on the working directory to make sure
210 untracked cache can be used. You have to manually enable
435ec090
CC
211 untracked cache using `--untracked-cache` or
212 `--force-untracked-cache` or the `core.untrackedCache`
213 configuration variable afterwards if you really want to use
214 it. If a test fails the exit code is 1 and a message
215 explains what is not working as needed, otherwise the exit
216 code is 0 and OK is printed.
eaab83d0 217
f64cb88d 218--force-untracked-cache::
435ec090
CC
219 Same as `--untracked-cache`. Provided for backwards
220 compatibility with older versions of Git where
221 `--untracked-cache` used to imply `--test-untracked-cache` but
222 this option would enable the extension unconditionally.
f64cb88d 223
780494b1
BP
224--fsmonitor::
225--no-fsmonitor::
226 Enable or disable files system monitor feature. These options
227 take effect whatever the value of the `core.fsmonitor`
228 configuration variable (see linkgit:git-config[1]). But a warning
229 is emitted when the change goes against the configured value, as
230 the configured value will take effect next time the index is
231 read and this will remove the intended effect of the option.
232
e994004f 233\--::
2cf565c5
DG
234 Do not interpret any more arguments as options.
235
236<file>::
237 Files to act on.
5773c9f2 238 Note that files beginning with '.' are discarded. This includes
a6080a0a 239 `./file` and `dir/./file`. If you don't want this, then use
2cf565c5
DG
240 cleaner names.
241 The same applies to directories ending '/' and paths with '//'
242
76a8788c 243USING --REFRESH
2cf565c5 244---------------
bcf9626a 245`--refresh` does not calculate a new sha1 file or bring the index
7560f547 246up to date for mode/content changes. But what it *does* do is to
5f3aa197
LS
247"re-match" the stat information of a file with the index, so that you
248can refresh the index for a file that hasn't been changed but where
2cf565c5
DG
249the stat entry is out of date.
250
0b444cdb 251For example, you'd want to do this after doing a 'git read-tree', to link
5f3aa197 252up the stat index details with the proper files.
2cf565c5 253
76a8788c 254USING --CACHEINFO OR --INFO-ONLY
df6e1516 255--------------------------------
bcf9626a 256`--cacheinfo` is used to register a file that is not in the
df6e1516
BL
257current working directory. This is useful for minimum-checkout
258merging.
259
388d0ff6 260To pretend you have a file at path with mode and sha1, say:
2cf565c5 261
61f693bd 262----------------
388d0ff6 263$ git update-index --add --cacheinfo <mode>,<sha1>,<path>
61f693bd 264----------------
2cf565c5 265
bcf9626a 266`--info-only` is used to register files without placing them in the object
df6e1516 267database. This is useful for status-only repositories.
2cf565c5 268
bcf9626a
MM
269Both `--cacheinfo` and `--info-only` behave similarly: the index is updated
270but the object database isn't. `--cacheinfo` is useful when the object is
271in the database but the file isn't available locally. `--info-only` is
df6e1516
BL
272useful when the file is available, but you do not wish to update the
273object database.
274
d23748a6 275
76a8788c 276USING --INDEX-INFO
d23748a6
JH
277------------------
278
279`--index-info` is a more powerful mechanism that lets you feed
280multiple entry definitions from the standard input, and designed
281specifically for scripts. It can take inputs of three formats:
282
d23748a6
JH
283 . mode SP type SP sha1 TAB path
284+
e05aa688 285This format is to stuff `git ls-tree` output into the index.
d23748a6
JH
286
287 . mode SP sha1 SP stage TAB path
288+
289This format is to put higher order stages into the
0b444cdb 290index file and matches 'git ls-files --stage' output.
d23748a6 291
e05aa688
JH
292 . mode SP sha1 TAB path
293+
294This format is no longer produced by any Git command, but is
295and will continue to be supported by `update-index --index-info`.
296
d23748a6
JH
297To place a higher stage entry to the index, the path should
298first be removed by feeding a mode=0 entry for the path, and
299then feeding necessary input lines in the third format.
300
301For example, starting with this index:
302
303------------
304$ git ls-files -s
305100644 8a1218a1024a212bb3db30becd860315f9f3ac52 0 frotz
306------------
307
308you can feed the following input to `--index-info`:
309
310------------
311$ git update-index --index-info
3120 0000000000000000000000000000000000000000 frotz
313100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1 frotz
314100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2 frotz
315------------
316
317The first line of the input feeds 0 as the mode to remove the
d5fa1f1a 318path; the SHA-1 does not matter as long as it is well formatted.
d23748a6
JH
319Then the second and third line feeds stage 1 and stage 2 entries
320for that path. After the above, we would end up with this:
321
322------------
323$ git ls-files -s
324100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1 frotz
325100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2 frotz
326------------
327
328
76a8788c 329USING ``ASSUME UNCHANGED'' BIT
bae777db 330------------------------------
f9666adf 331
2de9b711 332Many operations in Git depend on your filesystem to have an
f9666adf
JH
333efficient `lstat(2)` implementation, so that `st_mtime`
334information for working tree files can be cheaply checked to see
335if the file contents have changed from the version recorded in
336the index file. Unfortunately, some filesystems have
337inefficient `lstat(2)`. If your filesystem is one of them, you
338can set "assume unchanged" bit to paths you have not changed to
2de9b711
TA
339cause Git not to do this check. Note that setting this bit on a
340path does not mean Git will check the contents of the file to
341see if it has changed -- it makes Git to omit any checking and
f9666adf 342assume it has *not* changed. When you make changes to working
2de9b711 343tree files, you have to explicitly tell Git about it by dropping
f9666adf
JH
344"assume unchanged" bit, either before or after you modify them.
345
346In order to set "assume unchanged" bit, use `--assume-unchanged`
acd6d7e7
SN
347option. To unset, use `--no-assume-unchanged`. To see which files
348have the "assume unchanged" bit set, use `git ls-files -v`
349(see linkgit:git-ls-files[1]).
f9666adf
JH
350
351The command looks at `core.ignorestat` configuration variable. When
b1889c36 352this is true, paths updated with `git update-index paths...` and
2de9b711 353paths updated with other Git commands that update both index and
0b444cdb
TR
354working tree (e.g. 'git apply --index', 'git checkout-index -u',
355and 'git read-tree -u') are automatically marked as "assume
f9666adf 356unchanged". Note that "assume unchanged" bit is *not* set if
b1889c36
JN
357`git update-index --refresh` finds the working tree file matches
358the index (use `git update-index --really-refresh` if you want
f9666adf
JH
359to mark them as "assume unchanged").
360
9023535b
EN
361Sometimes users confuse the assume-unchanged bit with the
362skip-worktree bit. See the final paragraph in the "Skip-worktree bit"
363section below for an explanation of the differences.
364
f9666adf 365
76a8788c 366EXAMPLES
df6e1516 367--------
2cf565c5
DG
368To update and refresh only the files already checked out:
369
61f693bd 370----------------
b1889c36 371$ git checkout-index -n -f -a && git update-index --ignore-missing --refresh
61f693bd 372----------------
2cf565c5 373
48aeecdc
SE
374On an inefficient filesystem with `core.ignorestat` set::
375+
f9666adf 376------------
48aeecdc
SE
377$ git update-index --really-refresh <1>
378$ git update-index --no-assume-unchanged foo.c <2>
379$ git diff --name-only <3>
f9666adf 380$ edit foo.c
48aeecdc 381$ git diff --name-only <4>
f9666adf 382M foo.c
48aeecdc
SE
383$ git update-index foo.c <5>
384$ git diff --name-only <6>
f9666adf 385$ edit foo.c
48aeecdc
SE
386$ git diff --name-only <7>
387$ git update-index --no-assume-unchanged foo.c <8>
388$ git diff --name-only <9>
f9666adf 389M foo.c
48aeecdc
SE
390------------
391+
392<1> forces lstat(2) to set "assume unchanged" bits for paths that match index.
f9666adf
JH
393<2> mark the path to be edited.
394<3> this does lstat(2) and finds index matches the path.
48aeecdc 395<4> this does lstat(2) and finds index does *not* match the path.
f9666adf
JH
396<5> registering the new version to index sets "assume unchanged" bit.
397<6> and it is assumed unchanged.
398<7> even after you edit it.
399<8> you can tell about the change after the fact.
400<9> now it checks with lstat(2) and finds it has been changed.
f9666adf 401
2cf565c5 402
76a8788c 403SKIP-WORKTREE BIT
44a36913
NTND
404-----------------
405
9023535b
EN
406Skip-worktree bit can be defined in one (long) sentence: Tell git to
407avoid writing the file to the working directory when reasonably
408possible, and treat the file as unchanged when it is not
409present in the working directory.
410
411Note that not all git commands will pay attention to this bit, and
412some only partially support it.
413
414The update-index flags and the read-tree capabilities relating to the
415skip-worktree bit predated the introduction of the
416linkgit:git-sparse-checkout[1] command, which provides a much easier
417way to configure and handle the skip-worktree bits. If you want to
418reduce your working tree to only deal with a subset of the files in
419the repository, we strongly encourage the use of
420linkgit:git-sparse-checkout[1] in preference to the low-level
421update-index and read-tree primitives.
422
423The primary purpose of the skip-worktree bit is to enable sparse
424checkouts, i.e. to have working directories with only a subset of
425paths present. When the skip-worktree bit is set, Git commands (such
426as `switch`, `pull`, `merge`) will avoid writing these files.
427However, these commands will sometimes write these files anyway in
428important cases such as conflicts during a merge or rebase. Git
429commands will also avoid treating the lack of such files as an
c9dba103 430intentional deletion; for example `git add -u` will not stage a
9023535b
EN
431deletion for these files and `git commit -a` will not make a commit
432deleting them either.
44a36913
NTND
433
434Although this bit looks similar to assume-unchanged bit, its goal is
9023535b
EN
435different. The assume-unchanged bit is for leaving the file in the
436working tree but having Git omit checking it for changes and presuming
437that the file has not been changed (though if it can determine without
438stat'ing the file that it has changed, it is free to record the
439changes). skip-worktree tells Git to ignore the absence of the file,
440avoid updating it when possible with commands that normally update
441much of the working directory (e.g. `checkout`, `switch`, `pull`,
442etc.), and not have its absence be recorded in commits. Note that in
443sparse checkouts (setup by `git sparse-checkout` or by configuring
444core.sparseCheckout to true), if a file is marked as skip-worktree in
445the index but is found in the working tree, Git will clear the
446skip-worktree bit for that file.
44a36913 447
76a8788c 448SPLIT INDEX
b4601395
CC
449-----------
450
451This mode is designed for repositories with very large indexes, and
452aims at reducing the time it takes to repeatedly write these indexes.
453
454In this mode, the index is split into two files, $GIT_DIR/index and
455$GIT_DIR/sharedindex.<SHA-1>. Changes are accumulated in
456$GIT_DIR/index, the split index, while the shared index file contains
457all index entries and stays unchanged.
458
459All changes in the split index are pushed back to the shared index
460file when the number of entries in the split index reaches a level
461specified by the splitIndex.maxPercentChange config variable (see
462linkgit:git-config[1]).
463
464Each time a new shared index file is created, the old shared index
465files are deleted if their modification time is older than what is
466specified by the splitIndex.sharedIndexExpire config variable (see
467linkgit:git-config[1]).
468
469To avoid deleting a shared index file that is still used, its
031fd4b9 470modification time is updated to the current time every time a new split
b4601395
CC
471index based on the shared index file is either created or read from.
472
76a8788c 473UNTRACKED CACHE
435ec090
CC
474---------------
475
476This cache is meant to speed up commands that involve determining
477untracked files such as `git status`.
478
479This feature works by recording the mtime of the working tree
480directories and then omitting reading directories and stat calls
481against files in those directories whose mtime hasn't changed. For
482this to work the underlying operating system and file system must
483change the `st_mtime` field of directories if files in the directory
484are added, modified or deleted.
485
486You can test whether the filesystem supports that with the
487`--test-untracked-cache` option. The `--untracked-cache` option used
488to implicitly perform that test in older versions of Git, but that's
489no longer the case.
490
491If you want to enable (or disable) this feature, it is easier to use
492the `core.untrackedCache` configuration variable (see
493linkgit:git-config[1]) than using the `--untracked-cache` option to
494`git update-index` in each repository, especially if you want to do so
495across all repositories you use, because you can set the configuration
496variable to `true` (or `false`) in your `$HOME/.gitconfig` just once
497and have it affect all repositories you touch.
498
499When the `core.untrackedCache` configuration variable is changed, the
500untracked cache is added to or removed from the index the next time a
501command reads the index; while when `--[no-|force-]untracked-cache`
502are used, the untracked cache is immediately added to or removed from
503the index.
44a36913 504
9b978691
ÆAB
505Before 2.17, the untracked cache had a bug where replacing a directory
506with a symlink to another directory could cause it to incorrectly show
507files tracked by git as untracked. See the "status: add a failing test
508showing a core.untrackedCache bug" commit to git.git. A workaround for
509that is (and this might work for other undiscovered bugs in the
510future):
511
512----------------
513$ git -c core.untrackedCache=false status
514----------------
515
516This bug has also been shown to affect non-symlink cases of replacing
517a directory with a file when it comes to the internal structures of
518the untracked cache, but no case has been reported where this resulted in
519wrong "git status" output.
520
7bf0be75
ÆAB
521There are also cases where existing indexes written by git versions
522before 2.17 will reference directories that don't exist anymore,
523potentially causing many "could not open directory" warnings to be
524printed on "git status". These are new warnings for existing issues
525that were previously silently discarded.
526
527As with the bug described above the solution is to one-off do a "git
528status" run with `core.untrackedCache=false` to flush out the leftover
529bad data.
530
76a8788c 531FILE SYSTEM MONITOR
780494b1
BP
532-------------------
533
534This feature is intended to speed up git operations for repos that have
535large working directories.
536
32484869 537It enables git to work together with a file system monitor (see
f3ea4bed 538linkgit:git-fsmonitor{litdd}daemon[1]
32484869 539and the
780494b1
BP
540"fsmonitor-watchman" section of linkgit:githooks[5]) that can
541inform it as to what files have been modified. This enables git to avoid
542having to lstat() every file to find modified files.
543
544When used in conjunction with the untracked cache, it can further improve
545performance by avoiding the cost of scanning the entire working directory
546looking for new files.
547
548If you want to enable (or disable) this feature, it is easier to use
549the `core.fsmonitor` configuration variable (see
32484869
JH
550linkgit:git-config[1]) than using the `--fsmonitor` option to `git
551update-index` in each repository, especially if you want to do so
780494b1 552across all repositories you use, because you can set the configuration
4ccf461f
BP
553variable in your `$HOME/.gitconfig` just once and have it affect all
554repositories you touch.
780494b1
BP
555
556When the `core.fsmonitor` configuration variable is changed, the
557file system monitor is added to or removed from the index the next time
558a command reads the index. When `--[no-]fsmonitor` are used, the file
559system monitor is immediately added to or removed from the index.
560
76a8788c 561CONFIGURATION
5773c9f2
JH
562-------------
563
564The command honors `core.filemode` configuration variable. If
466d1f15 565your repository is on a filesystem whose executable bits are
5162e697 566unreliable, this should be set to 'false' (see linkgit:git-config[1]).
61f693bd
JL
567This causes the command to ignore differences in file modes recorded
568in the index and the file mode on the filesystem if they differ only on
5773c9f2 569executable bit. On such an unfortunate filesystem, you may
0b444cdb 570need to use 'git update-index --chmod='.
5773c9f2 571
78a8d641 572Quite similarly, if `core.symlinks` configuration variable is set
5162e697 573to 'false' (see linkgit:git-config[1]), symbolic links are checked out
78a8d641
JS
574as plain files, and this command does not modify a recorded file mode
575from symbolic link to regular file.
576
f9666adf
JH
577The command looks at `core.ignorestat` configuration variable. See
578'Using "assume unchanged" bit' section above.
579
1ce4790b
AR
580The command also looks at `core.trustctime` configuration variable.
581It can be useful when the inode change time is regularly modified by
582something outside Git (file system crawlers and backup systems use
583ctime for marking files processed) (see linkgit:git-config[1]).
584
435ec090
CC
585The untracked cache extension can be enabled by the
586`core.untrackedCache` configuration variable (see
587linkgit:git-config[1]).
61f693bd 588
1b13e903 589NOTES
590-----
591
592Users often try to use the assume-unchanged and skip-worktree bits
593to tell Git to ignore changes to files that are tracked. This does not
594work as expected, since Git may still check working tree files against
595the index when performing certain operations. In general, Git does not
596provide a way to ignore changes to tracked files, so alternate solutions
597are recommended.
598
599For example, if the file you want to change is some sort of config file,
600the repository can include a sample config file that can then be copied
601into the ignored name and modified. The repository can even include a
602script to treat the sample file as a template, modifying and copying it
603automatically.
604
56ae8df5 605SEE ALSO
61f693bd 606--------
5162e697 607linkgit:git-config[1],
acd6d7e7
SN
608linkgit:git-add[1],
609linkgit:git-ls-files[1]
61f693bd 610
2cf565c5
DG
611GIT
612---
9e1f0a85 613Part of the linkgit:git[1] suite