Documentation / git-update-index.txton commit GIT 0.99.9l aka 1.0rc4 (423325a)
   1git-update-index(1)
   2===================
   3
   4NAME
   5----
   6git-update-index - Modifies the index or directory cache
   7
   8
   9SYNOPSIS
  10--------
  11'git-update-index'
  12             [--add] [--remove | --force-remove] [--replace] 
  13             [--refresh [-q] [--unmerged] [--ignore-missing]]
  14             [--cacheinfo <mode> <object> <file>]\*
  15             [--chmod=(+|-)x]
  16             [--info-only] [--index-info]
  17             [-z] [--stdin]
  18             [--verbose]
  19             [--] [<file>]\*
  20
  21DESCRIPTION
  22-----------
  23Modifies the index or directory cache. Each file mentioned is updated
  24into the index and any 'unmerged' or 'needs updating' state is
  25cleared.
  26
  27The way "git-update-index" handles files it is told about can be modified
  28using the various options:
  29
  30OPTIONS
  31-------
  32--add::
  33        If a specified file isn't in the index already then it's
  34        added.
  35        Default behaviour is to ignore new files.
  36
  37--remove::
  38        If a specified file is in the index but is missing then it's
  39        removed.
  40        Default behaviour is to ignore removed file.
  41
  42--refresh::
  43        Looks at the current index and checks to see if merges or
  44        updates are needed by checking stat() information.
  45
  46-q::
  47        Quiet.  If --refresh finds that the index needs an update, the
  48        default behavior is to error out.  This option makes
  49        git-update-index continue anyway.
  50
  51--unmerged::
  52        If --refresh finds unmerged changes in the index, the default
  53        behavior is to error out.  This option makes git-update-index 
  54        continue anyway.
  55
  56--ignore-missing::
  57        Ignores missing files during a --refresh
  58
  59--cacheinfo <mode> <object> <path>::
  60        Directly insert the specified info into the index.
  61        
  62--index-info::
  63        Read index information from stdin.
  64
  65--chmod=(+|-)x::
  66        Set the execute permissions on the updated files.        
  67
  68--info-only::
  69        Do not create objects in the object database for all
  70        <file> arguments that follow this flag; just insert
  71        their object IDs into the index.
  72
  73--force-remove::
  74        Remove the file from the index even when the working directory
  75        still has such a file. (Implies --remove.)
  76
  77--replace::
  78        By default, when a file `path` exists in the index,
  79        git-update-index refuses an attempt to add `path/file`.
  80        Similarly if a file `path/file` exists, a file `path`
  81        cannot be added.  With --replace flag, existing entries
  82        that conflicts with the entry being added are
  83        automatically removed with warning messages.
  84
  85--stdin::
  86        Instead of taking list of paths from the command line,
  87        read list of paths from the standard input.  Paths are
  88        separated by LF (i.e. one path per line) by default.
  89
  90--verbose::
  91        Report what is being added and removed from index.
  92
  93-z::
  94        Only meaningful with `--stdin`; paths are separated with
  95        NUL character instead of LF.
  96
  97--::
  98        Do not interpret any more arguments as options.
  99
 100<file>::
 101        Files to act on.
 102        Note that files beginning with '.' are discarded. This includes
 103        `./file` and `dir/./file`. If you don't want this, then use     
 104        cleaner names.
 105        The same applies to directories ending '/' and paths with '//'
 106
 107Using --refresh
 108---------------
 109'--refresh' does not calculate a new sha1 file or bring the index
 110up-to-date for mode/content changes. But what it *does* do is to
 111"re-match" the stat information of a file with the index, so that you
 112can refresh the index for a file that hasn't been changed but where
 113the stat entry is out of date.
 114
 115For example, you'd want to do this after doing a "git-read-tree", to link
 116up the stat index details with the proper files.
 117
 118Using --cacheinfo or --info-only
 119--------------------------------
 120'--cacheinfo' is used to register a file that is not in the
 121current working directory.  This is useful for minimum-checkout
 122merging.
 123
 124To pretend you have a file with mode and sha1 at path, say:
 125
 126   $ git-update-index --cacheinfo mode sha1 path
 127
 128'--info-only' is used to register files without placing them in the object
 129database.  This is useful for status-only repositories.
 130
 131Both '--cacheinfo' and '--info-only' behave similarly: the index is updated
 132but the object database isn't.  '--cacheinfo' is useful when the object is
 133in the database but the file isn't available locally.  '--info-only' is
 134useful when the file is available, but you do not wish to update the
 135object database.
 136
 137Examples
 138--------
 139To update and refresh only the files already checked out:
 140
 141   git-checkout-index -n -f -a && git-update-index --ignore-missing --refresh
 142
 143
 144Configuration
 145-------------
 146
 147The command honors `core.filemode` configuration variable.  If
 148your repository is on an filesystem whose executable bits are
 149unreliable, this should be set to 'false'.  This causes the
 150command to ignore differences in file modes recorded in the
 151index and the file mode on the filesystem if they differ only on
 152executable bit.   On such an unfortunate filesystem, you may
 153need to use `git-update-index --chmod=`.
 154
 155Author
 156------
 157Written by Linus Torvalds <torvalds@osdl.org>
 158
 159Documentation
 160--------------
 161Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
 162
 163GIT
 164---
 165Part of the gitlink:git[7] suite
 166