Documentation / git-update-cache.txton commit git-apply: creatign empty files is nonfatal (af3f929)
   1git-update-cache(1)
   2===================
   3v0.1, May 2005
   4
   5NAME
   6----
   7git-update-cache - Modifies the index or directory cache
   8
   9
  10SYNOPSIS
  11--------
  12'git-update-cache'
  13             [--add] [--remove] [--refresh] [--replace]
  14             [--ignore-missing]
  15             [--force-remove]
  16             [--cacheinfo <mode> <object> <file>]\*
  17             [--] [<file>]\*
  18
  19DESCRIPTION
  20-----------
  21Modifies the index or directory cache. Each file mentioned is updated
  22into the cache and any 'unmerged' or 'needs updating' state is
  23cleared.
  24
  25The way "git-update-cache" handles files it is told about can be modified
  26using the various options:
  27
  28OPTIONS
  29-------
  30--add::
  31        If a specified file isn't in the cache already then it's
  32        added.
  33        Default behaviour is to ignore new files.
  34
  35--remove::
  36        If a specified file is in the cache but is missing then it's
  37        removed.
  38        Default behaviour is to ignore removed file.
  39
  40--refresh::
  41        Looks at the current cache and checks to see if merges or
  42        updates are needed by checking stat() information.
  43
  44--ignore-missing::
  45        Ignores missing files during a --refresh
  46
  47--cacheinfo <mode> <object> <path>::
  48        Directly insert the specified info into the cache.
  49        
  50--force-remove::
  51        Remove the file from the index even when the working directory
  52        still has such a file. (Implies --remove.)
  53
  54--replace::
  55        By default, when a file `path` exists in the index,
  56        git-update-cache refuses an attempt to add `path/file`.
  57        Similarly if a file `path/file` exists, a file `path`
  58        cannot be added.  With --replace flag, existing entries
  59        that conflicts with the entry being added are
  60        automatically removed with warning messages.
  61
  62--::
  63        Do not interpret any more arguments as options.
  64
  65<file>::
  66        Files to act on.
  67        Note that files begining with '.' are discarded. This includes
  68        `./file` and `dir/./file`. If you don't want this, then use     
  69        cleaner names.
  70        The same applies to directories ending '/' and paths with '//'
  71
  72Using --refresh
  73---------------
  74'--refresh' does not calculate a new sha1 file or bring the cache
  75up-to-date for mode/content changes. But what it *does* do is to
  76"re-match" the stat information of a file with the cache, so that you
  77can refresh the cache for a file that hasn't been changed but where
  78the stat entry is out of date.
  79
  80For example, you'd want to do this after doing a "git-read-tree", to link
  81up the stat cache details with the proper files.
  82
  83Using --cacheinfo
  84-----------------
  85'--cacheinfo' is used to register a file that is not in the current
  86working directory.  This is useful for minimum-checkout merging.
  87
  88To pretend you have a file with mode and sha1 at path, say:
  89
  90 $ git-update-cache --cacheinfo mode sha1 path
  91
  92To update and refresh only the files already checked out:
  93
  94   git-checkout-cache -n -f -a && git-update-cache --ignore-missing --refresh
  95
  96
  97Author
  98------
  99Written by Linus Torvalds <torvalds@osdl.org>
 100
 101Documentation
 102--------------
 103Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
 104
 105GIT
 106---
 107Part of the link:git.html[git] suite
 108