summaryrefslogtreecommitdiffstats
path: root/git-update-index.html
diff options
context:
space:
mode:
authorJunio C Hamano <junio@hera.kernel.org>2005-12-27 00:17:23 -0800
committerJunio C Hamano <junio@hera.kernel.org>2005-12-27 00:17:23 -0800
commit1a4e841b439ba014b365999c3a6b9e2be3740bd8 (patch)
tree263dbc68b55d73929f82a6d1f7df677dfb06e294 /git-update-index.html
downloadgit-htmldocs-1a4e841b439ba014b365999c3a6b9e2be3740bd8.tar.gz
Autogenerated HTML docs for 36de72aa9dc3b7daf8cf2770c840f39bb0d2ae70
Diffstat (limited to 'git-update-index.html')
-rw-r--r--git-update-index.html584
1 files changed, 584 insertions, 0 deletions
diff --git a/git-update-index.html b/git-update-index.html
new file mode 100644
index 000000000..d97d30dce
--- /dev/null
+++ b/git-update-index.html
@@ -0,0 +1,584 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<meta name="generator" content="AsciiDoc 7.0.1" />
+<style type="text/css">
+/* Debug borders */
+p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
+/*
+ border: 1px solid red;
+*/
+}
+
+body {
+ margin: 1em 5% 1em 5%;
+}
+
+a { color: blue; }
+a:visited { color: fuchsia; }
+
+em {
+ font-style: italic;
+}
+
+strong {
+ font-weight: bold;
+}
+
+tt {
+ color: navy;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ color: #527bbd;
+ font-family: sans-serif;
+ margin-top: 1.2em;
+ margin-bottom: 0.5em;
+ line-height: 1.3;
+}
+
+h1 {
+ border-bottom: 2px solid silver;
+}
+h2 {
+ border-bottom: 2px solid silver;
+ padding-top: 0.5em;
+}
+
+div.sectionbody {
+ font-family: serif;
+ margin-left: 0;
+}
+
+hr {
+ border: 1px solid silver;
+}
+
+p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+}
+
+pre {
+ padding: 0;
+ margin: 0;
+}
+
+span#author {
+ color: #527bbd;
+ font-family: sans-serif;
+ font-weight: bold;
+ font-size: 1.2em;
+}
+span#email {
+}
+span#revision {
+ font-family: sans-serif;
+}
+
+div#footer {
+ font-family: sans-serif;
+ font-size: small;
+ border-top: 2px solid silver;
+ padding-top: 0.5em;
+ margin-top: 4.0em;
+}
+div#footer-text {
+ float: left;
+ padding-bottom: 0.5em;
+}
+div#footer-badges {
+ float: right;
+ padding-bottom: 0.5em;
+}
+
+div#preamble,
+div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
+div.admonitionblock {
+ margin-right: 10%;
+ margin-top: 1.5em;
+ margin-bottom: 1.5em;
+}
+div.admonitionblock {
+ margin-top: 2.5em;
+ margin-bottom: 2.5em;
+}
+
+div.content { /* Block element content. */
+ padding: 0;
+}
+
+/* Block element titles. */
+div.title, caption.title {
+ font-family: sans-serif;
+ font-weight: bold;
+ text-align: left;
+ margin-top: 1.0em;
+ margin-bottom: 0.5em;
+}
+div.title + * {
+ margin-top: 0;
+}
+
+td div.title:first-child {
+ margin-top: 0.0em;
+}
+div.content div.title:first-child {
+ margin-top: 0.0em;
+}
+div.content + div.title {
+ margin-top: 0.0em;
+}
+
+div.sidebarblock > div.content {
+ background: #ffffee;
+ border: 1px solid silver;
+ padding: 0.5em;
+}
+
+div.listingblock > div.content {
+ border: 1px solid silver;
+ background: #f4f4f4;
+ padding: 0.5em;
+}
+
+div.quoteblock > div.content {
+ padding-left: 2.0em;
+}
+div.quoteblock .attribution {
+ text-align: right;
+}
+
+div.admonitionblock .icon {
+ vertical-align: top;
+ font-size: 1.1em;
+ font-weight: bold;
+ text-decoration: underline;
+ color: #527bbd;
+ padding-right: 0.5em;
+}
+div.admonitionblock td.content {
+ padding-left: 0.5em;
+ border-left: 2px solid silver;
+}
+
+div.exampleblock > div.content {
+ border-left: 2px solid silver;
+ padding: 0.5em;
+}
+
+div.verseblock div.content {
+ white-space: pre;
+}
+
+div.imageblock div.content { padding-left: 0; }
+div.imageblock img { border: 1px solid silver; }
+span.image img { border-style: none; }
+
+dl {
+ margin-top: 0.8em;
+ margin-bottom: 0.8em;
+}
+dt {
+ margin-top: 0.5em;
+ margin-bottom: 0;
+ font-style: italic;
+}
+dd > *:first-child {
+ margin-top: 0;
+}
+
+ul, ol {
+ list-style-position: outside;
+}
+ol.olist2 {
+ list-style-type: lower-alpha;
+}
+
+div.tableblock > table {
+ border-color: #527bbd;
+ border-width: 3px;
+}
+thead {
+ font-family: sans-serif;
+ font-weight: bold;
+}
+tfoot {
+ font-weight: bold;
+}
+
+div.hlist {
+ margin-top: 0.8em;
+ margin-bottom: 0.8em;
+}
+td.hlist1 {
+ vertical-align: top;
+ font-style: italic;
+ padding-right: 0.8em;
+}
+td.hlist2 {
+ vertical-align: top;
+}
+
+@media print {
+ div#footer-badges { display: none; }
+}
+include::./stylesheets/xhtml11-manpage.css[]
+/* Workarounds for IE6's broken and incomplete CSS2. */
+
+div.sidebar-content {
+ background: #ffffee;
+ border: 1px solid silver;
+ padding: 0.5em;
+}
+div.sidebar-title, div.image-title {
+ font-family: sans-serif;
+ font-weight: bold;
+ margin-top: 0.0em;
+ margin-bottom: 0.5em;
+}
+
+div.listingblock div.content {
+ border: 1px solid silver;
+ background: #f4f4f4;
+ padding: 0.5em;
+}
+
+div.quoteblock-content {
+ padding-left: 2.0em;
+}
+
+div.exampleblock-content {
+ border-left: 2px solid silver;
+ padding-left: 0.5em;
+}
+</style>
+<title>git-update-index(1)</title>
+</head>
+<body>
+<div id="header">
+<h1>
+git-update-index(1) Manual Page
+</h1>
+<h2>NAME</h2>
+<div class="sectionbody">
+<p>git-update-index -
+ Modifies the index or directory cache
+</p>
+</div>
+</div>
+<h2>SYNOPSIS</h2>
+<div class="sectionbody">
+<p><em>git-update-index</em>
+ [--add] [--remove | --force-remove] [--replace]
+ [--refresh [-q] [--unmerged] [--ignore-missing]]
+ [--cacheinfo &lt;mode&gt; &lt;object&gt; &lt;file&gt;]*
+ [--chmod=(+|-)x]
+ [--info-only] [--index-info]
+ [-z] [--stdin]
+ [--verbose]
+ [--] [&lt;file&gt;]*</p>
+</div>
+<h2>DESCRIPTION</h2>
+<div class="sectionbody">
+<p>Modifies the index or directory cache. Each file mentioned is updated
+into the index and any <em>unmerged</em> or <em>needs updating</em> state is
+cleared.</p>
+<p>The way "git-update-index" handles files it is told about can be modified
+using the various options:</p>
+</div>
+<h2>OPTIONS</h2>
+<div class="sectionbody">
+<dl>
+<dt>
+--add
+</dt>
+<dd>
+<p>
+ If a specified file isn't in the index already then it's
+ added.
+ Default behaviour is to ignore new files.
+</p>
+</dd>
+<dt>
+--remove
+</dt>
+<dd>
+<p>
+ If a specified file is in the index but is missing then it's
+ removed.
+ Default behaviour is to ignore removed file.
+</p>
+</dd>
+<dt>
+--refresh
+</dt>
+<dd>
+<p>
+ Looks at the current index and checks to see if merges or
+ updates are needed by checking stat() information.
+</p>
+</dd>
+<dt>
+-q
+</dt>
+<dd>
+<p>
+ Quiet. If --refresh finds that the index needs an update, the
+ default behavior is to error out. This option makes
+ git-update-index continue anyway.
+</p>
+</dd>
+<dt>
+--unmerged
+</dt>
+<dd>
+<p>
+ If --refresh finds unmerged changes in the index, the default
+ behavior is to error out. This option makes git-update-index
+ continue anyway.
+</p>
+</dd>
+<dt>
+--ignore-missing
+</dt>
+<dd>
+<p>
+ Ignores missing files during a --refresh
+</p>
+</dd>
+<dt>
+--cacheinfo &lt;mode&gt; &lt;object&gt; &lt;path&gt;
+</dt>
+<dd>
+<p>
+ Directly insert the specified info into the index.
+</p>
+</dd>
+<dt>
+--index-info
+</dt>
+<dd>
+<p>
+ Read index information from stdin.
+</p>
+</dd>
+<dt>
+--chmod=(+|-)x
+</dt>
+<dd>
+<p>
+ Set the execute permissions on the updated files.
+</p>
+</dd>
+<dt>
+--info-only
+</dt>
+<dd>
+<p>
+ Do not create objects in the object database for all
+ &lt;file&gt; arguments that follow this flag; just insert
+ their object IDs into the index.
+</p>
+</dd>
+<dt>
+--force-remove
+</dt>
+<dd>
+<p>
+ Remove the file from the index even when the working directory
+ still has such a file. (Implies --remove.)
+</p>
+</dd>
+<dt>
+--replace
+</dt>
+<dd>
+<p>
+ By default, when a file <tt>path</tt> exists in the index,
+ git-update-index refuses an attempt to add <tt>path/file</tt>.
+ Similarly if a file <tt>path/file</tt> exists, a file <tt>path</tt>
+ cannot be added. With --replace flag, existing entries
+ that conflicts with the entry being added are
+ automatically removed with warning messages.
+</p>
+</dd>
+<dt>
+--stdin
+</dt>
+<dd>
+<p>
+ Instead of taking list of paths from the command line,
+ read list of paths from the standard input. Paths are
+ separated by LF (i.e. one path per line) by default.
+</p>
+</dd>
+<dt>
+--verbose
+</dt>
+<dd>
+<p>
+ Report what is being added and removed from index.
+</p>
+</dd>
+<dt>
+-z
+</dt>
+<dd>
+<p>
+ Only meaningful with <tt>--stdin</tt>; paths are separated with
+ NUL character instead of LF.
+</p>
+</dd>
+<dt>
+&#8212;
+</dt>
+<dd>
+<p>
+ Do not interpret any more arguments as options.
+</p>
+</dd>
+<dt>
+&lt;file&gt;
+</dt>
+<dd>
+<p>
+ Files to act on.
+ Note that files beginning with <em>.</em> are discarded. This includes
+ <tt>./file</tt> and <tt>dir/./file</tt>. If you don't want this, then use
+ cleaner names.
+ The same applies to directories ending <em>/</em> and paths with <em>//</em>
+</p>
+</dd>
+</dl>
+</div>
+<h2>Using --refresh</h2>
+<div class="sectionbody">
+<p><em>--refresh</em> does not calculate a new sha1 file or bring the index
+up-to-date for mode/content changes. But what it <strong>does</strong> do is to
+"re-match" the stat information of a file with the index, so that you
+can refresh the index for a file that hasn't been changed but where
+the stat entry is out of date.</p>
+<p>For example, you'd want to do this after doing a "git-read-tree", to link
+up the stat index details with the proper files.</p>
+</div>
+<h2>Using --cacheinfo or --info-only</h2>
+<div class="sectionbody">
+<p><em>--cacheinfo</em> is used to register a file that is not in the
+current working directory. This is useful for minimum-checkout
+merging.</p>
+<p>To pretend you have a file with mode and sha1 at path, say:</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>$ git-update-index --cacheinfo mode sha1 path</tt></pre>
+</div></div>
+<p><em>--info-only</em> is used to register files without placing them in the object
+database. This is useful for status-only repositories.</p>
+<p>Both <em>--cacheinfo</em> and <em>--info-only</em> behave similarly: the index is updated
+but the object database isn't. <em>--cacheinfo</em> is useful when the object is
+in the database but the file isn't available locally. <em>--info-only</em> is
+useful when the file is available, but you do not wish to update the
+object database.</p>
+</div>
+<h2>Using --index-info</h2>
+<div class="sectionbody">
+<p><tt>--index-info</tt> is a more powerful mechanism that lets you feed
+multiple entry definitions from the standard input, and designed
+specifically for scripts. It can take inputs of three formats:</p>
+<ol>
+<li>
+<p>
+mode SP sha1 TAB path
+</p>
+<p>The first format is what "git-apply --index-info"
+reports, and used to reconstruct a partial tree
+that is used for phony merge base tree when falling
+back on 3-way merge.</p>
+</li>
+<li>
+<p>
+mode SP type SP sha1 TAB path
+</p>
+<p>The second format is to stuff git-ls-tree output
+into the index file.</p>
+</li>
+<li>
+<p>
+mode SP sha1 SP stage TAB path
+</p>
+<p>This format is to put higher order stages into the
+index file and matches git-ls-files --stage output.</p>
+</li>
+</ol>
+<p>To place a higher stage entry to the index, the path should
+first be removed by feeding a mode=0 entry for the path, and
+then feeding necessary input lines in the third format.</p>
+<p>For example, starting with this index:</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>$ git ls-files -s
+100644 8a1218a1024a212bb3db30becd860315f9f3ac52 0 frotz</tt></pre>
+</div></div>
+<p>you can feed the following input to <tt>--index-info</tt>:</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>$ git update-index --index-info
+0 0000000000000000000000000000000000000000 frotz
+100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1 frotz
+100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2 frotz</tt></pre>
+</div></div>
+<p>The first line of the input feeds 0 as the mode to remove the
+path; the SHA1 does not matter as long as it is well formatted.
+Then the second and third line feeds stage 1 and stage 2 entries
+for that path. After the above, we would end up with this:</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>$ git ls-files -s
+100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1 frotz
+100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2 frotz</tt></pre>
+</div></div>
+</div>
+<h2>Examples</h2>
+<div class="sectionbody">
+<p>To update and refresh only the files already checked out:</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>$ git-checkout-index -n -f -a &amp;&amp; git-update-index --ignore-missing --refresh</tt></pre>
+</div></div>
+</div>
+<h2>Configuration</h2>
+<div class="sectionbody">
+<p>The command honors <tt>core.filemode</tt> configuration variable. If
+your repository is on an filesystem whose executable bits are
+unreliable, this should be set to <em>false</em> (see <a href="git-repo-config.html">git-repo-config(1)</a>).
+This causes the command to ignore differences in file modes recorded
+in the index and the file mode on the filesystem if they differ only on
+executable bit. On such an unfortunate filesystem, you may
+need to use <tt>git-update-index --chmod=</tt>.</p>
+</div>
+<h2>See Also</h2>
+<div class="sectionbody">
+<p><a href="git-repo-config.html">git-repo-config(1)</a></p>
+</div>
+<h2>Author</h2>
+<div class="sectionbody">
+<p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;</p>
+</div>
+<h2>Documentation</h2>
+<div class="sectionbody">
+<p>Documentation by David Greaves, Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p>
+</div>
+<h2>GIT</h2>
+<div class="sectionbody">
+<p>Part of the <a href="git.html">git(7)</a> suite</p>
+</div>
+<div id="footer">
+<div id="footer-text">
+Last updated 27-Dec-2005 00:16:52 PDT
+</div>
+</div>
+</body>
+</html>