summaryrefslogtreecommitdiffstats
path: root/git-read-tree.html
diff options
context:
space:
mode:
authorJunio C Hamano <junio@hera.kernel.org>2008-07-06 05:20:31 +0000
committerJunio C Hamano <junio@hera.kernel.org>2008-07-06 05:20:31 +0000
commitba4b9286c25f18c7ebbb809ee5732a7810377ab6 (patch)
tree390507328a7564b65dc803683c34235700b97409 /git-read-tree.html
parent05bf9c54a827e48b2b576488f5170a3490b5180e (diff)
downloadgit-htmldocs-ba4b9286c25f18c7ebbb809ee5732a7810377ab6.tar.gz
Autogenerated HTML docs for v1.5.6.2-212-g08b5
Diffstat (limited to 'git-read-tree.html')
-rw-r--r--git-read-tree.html256
1 files changed, 152 insertions, 104 deletions
diff --git a/git-read-tree.html b/git-read-tree.html
index f11717ecc..31d8eed02 100644
--- a/git-read-tree.html
+++ b/git-read-tree.html
@@ -3,7 +3,7 @@
<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.2" />
+<meta name="generator" content="AsciiDoc 8.2.5" />
<style type="text/css">
/* Debug borders */
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
@@ -16,8 +16,13 @@ body {
margin: 1em 5% 1em 5%;
}
-a { color: blue; }
-a:visited { color: fuchsia; }
+a {
+ color: blue;
+ text-decoration: underline;
+}
+a:visited {
+ color: fuchsia;
+}
em {
font-style: italic;
@@ -39,13 +44,18 @@ h1, h2, h3, h4, h5, h6 {
line-height: 1.3;
}
-h1 {
+h1, h2, h3 {
border-bottom: 2px solid silver;
}
h2 {
- border-bottom: 2px solid silver;
padding-top: 0.5em;
}
+h3 {
+ float: left;
+}
+h3 + * {
+ clear: left;
+}
div.sectionbody {
font-family: serif;
@@ -70,7 +80,7 @@ span#author {
color: #527bbd;
font-family: sans-serif;
font-weight: bold;
- font-size: 1.2em;
+ font-size: 1.1em;
}
span#email {
}
@@ -139,6 +149,9 @@ div.sidebarblock > div.content {
padding: 0.5em;
}
+div.listingblock {
+ margin-right: 0%;
+}
div.listingblock > div.content {
border: 1px solid silver;
background: #f4f4f4;
@@ -148,9 +161,13 @@ div.listingblock > div.content {
div.quoteblock > div.content {
padding-left: 2.0em;
}
-div.quoteblock .attribution {
+
+div.attribution {
text-align: right;
}
+div.verseblock + div.attribution {
+ text-align: left;
+}
div.admonitionblock .icon {
vertical-align: top;
@@ -194,13 +211,12 @@ dd > *:first-child {
ul, ol {
list-style-position: outside;
}
-ol.olist2 {
+div.olist2 ol {
list-style-type: lower-alpha;
}
div.tableblock > table {
- border-color: #527bbd;
- border-width: 3px;
+ border: 3px solid #527bbd;
}
thead {
font-family: sans-serif;
@@ -214,6 +230,9 @@ div.hlist {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
+div.hlist td {
+ padding-bottom: 5px;
+}
td.hlist1 {
vertical-align: top;
font-style: italic;
@@ -226,7 +245,33 @@ td.hlist2 {
@media print {
div#footer-badges { display: none; }
}
-include::./stylesheets/xhtml11-manpage.css[]
+
+div#toctitle {
+ color: #527bbd;
+ font-family: sans-serif;
+ font-size: 1.1em;
+ font-weight: bold;
+ margin-top: 1.0em;
+ margin-bottom: 0.1em;
+}
+
+div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+div.toclevel2 {
+ margin-left: 2em;
+ font-size: 0.9em;
+}
+div.toclevel3 {
+ margin-left: 4em;
+ font-size: 0.9em;
+}
+div.toclevel4 {
+ margin-left: 6em;
+ font-size: 0.9em;
+}
+include1::./stylesheets/xhtml11-manpage.css[]
/* Workarounds for IE6's broken and incomplete CSS2. */
div.sidebar-content {
@@ -255,6 +300,9 @@ div.exampleblock-content {
border-left: 2px solid silver;
padding-left: 0.5em;
}
+
+/* IE6 sets dynamically generated links as visited. */
+div#toc a:visited { color: blue; }
</style>
<title>git-read-tree(1)</title>
</head>
@@ -272,23 +320,23 @@ git-read-tree(1) Manual Page
</div>
<h2>SYNOPSIS</h2>
<div class="sectionbody">
-<p><em>git read-tree</em> (&lt;tree-ish&gt; | [[-m [--trivial] [--aggressive] | --reset | --prefix=&lt;prefix&gt;] [-u | -i]] [--exclude-per-directory=&lt;gitignore&gt;] [--index-output=&lt;file&gt;] &lt;tree-ish1&gt; [&lt;tree-ish2&gt; [&lt;tree-ish3&gt;]])</p>
+<div class="para"><p><em>git read-tree</em> (&lt;tree-ish&gt; | [[-m [--trivial] [--aggressive] | --reset | --prefix=&lt;prefix&gt;] [-u | -i]] [--exclude-per-directory=&lt;gitignore&gt;] [--index-output=&lt;file&gt;] &lt;tree-ish1&gt; [&lt;tree-ish2&gt; [&lt;tree-ish3&gt;]])</p></div>
</div>
-<h2>DESCRIPTION</h2>
+<h2 id="_description">DESCRIPTION</h2>
<div class="sectionbody">
-<p>Reads the tree information given by &lt;tree-ish&gt; into the index,
+<div class="para"><p>Reads the tree information given by &lt;tree-ish&gt; into the index,
but does not actually <strong>update</strong> any of the files it "caches". (see:
-<a href="git-checkout-index.html">git-checkout-index(1)</a>)</p>
-<p>Optionally, it can merge a tree into the index, perform a
+<a href="git-checkout-index.html">git-checkout-index(1)</a>)</p></div>
+<div class="para"><p>Optionally, it can merge a tree into the index, perform a
fast-forward (i.e. 2-way) merge, or a 3-way merge, with the <tt>-m</tt>
flag. When used with <tt>-m</tt>, the <tt>-u</tt> flag causes it to also update
-the files in the work tree with the result of the merge.</p>
-<p>Trivial merges are done by <tt>git-read-tree</tt> itself. Only conflicting paths
-will be in unmerged state when <tt>git-read-tree</tt> returns.</p>
+the files in the work tree with the result of the merge.</p></div>
+<div class="para"><p>Trivial merges are done by <em>git-read-tree</em> itself. Only conflicting paths
+will be in unmerged state when <em>git-read-tree</em> returns.</p></div>
</div>
-<h2>OPTIONS</h2>
+<h2 id="_options">OPTIONS</h2>
<div class="sectionbody">
-<dl>
+<div class="vlist"><dl>
<dt>
-m
</dt>
@@ -345,7 +393,7 @@ will be in unmerged state when <tt>git-read-tree</tt> returns.</p>
</dt>
<dd>
<p>
- Restrict three-way merge by <tt>git-read-tree</tt> to happen
+ Restrict three-way merge by <em>git-read-tree</em> to happen
only if there is no file-level merging required, instead
of resolving merge for trivial cases and leaving
conflicting files unresolved in the index.
@@ -356,13 +404,13 @@ will be in unmerged state when <tt>git-read-tree</tt> returns.</p>
</dt>
<dd>
<p>
- Usually a three-way merge by <tt>git-read-tree</tt> resolves
+ Usually a three-way merge by <em>git-read-tree</em> resolves
the merge for really trivial cases and leaves other
cases unresolved in the index, so that Porcelains can
implement different merge policies. This flag makes the
command to resolve a few more cases internally:
</p>
-<ul>
+<div class="ilist"><ul>
<li>
<p>
when one side removes a path and the other side leaves the path
@@ -380,7 +428,7 @@ when both sides adds a path identically. The resolution
is to add that path.
</p>
</li>
-</ul>
+</ul></div>
</dd>
<dt>
--prefix=&lt;prefix&gt;/
@@ -440,33 +488,33 @@ when both sides adds a path identically. The resolution
The id of the tree object(s) to be read/merged.
</p>
</dd>
-</dl>
+</dl></div>
</div>
-<h2>Merging</h2>
+<h2 id="_merging">Merging</h2>
<div class="sectionbody">
-<p>If <tt>-m</tt> is specified, <tt>git-read-tree</tt> can perform 3 kinds of
+<div class="para"><p>If <tt>-m</tt> is specified, <em>git-read-tree</em> can perform 3 kinds of
merge, a single tree merge if only 1 tree is given, a
fast-forward merge with 2 trees, or a 3-way merge if 3 trees are
-provided.</p>
-<h3>Single Tree Merge</h3>
-<p>If only 1 tree is specified, <tt>git-read-tree</tt> operates as if the user did not
+provided.</p></div>
+<h3 id="_single_tree_merge">Single Tree Merge</h3><div style="clear:left"></div>
+<div class="para"><p>If only 1 tree is specified, <em>git-read-tree</em> operates as if the user did not
specify <tt>-m</tt>, except that if the original index has an entry for a
given pathname, and the contents of the path matches with the tree
being read, the stat info from the index is used. (In other words, the
-index's stat()s take precedence over the merged tree's).</p>
-<p>That means that if you do a <tt>git read-tree -m &lt;newtree&gt;</tt> followed by a
-<tt>git checkout-index -f -u -a</tt>, the <tt>git-checkout-index</tt> only checks out
-the stuff that really changed.</p>
-<p>This is used to avoid unnecessary false hits when <tt>git-diff-files</tt> is
-run after <tt>git-read-tree</tt>.</p>
-<h3>Two Tree Merge</h3>
-<p>Typically, this is invoked as <tt>git read-tree -m $H $M</tt>, where $H
+index's stat()s take precedence over the merged tree's).</p></div>
+<div class="para"><p>That means that if you do a <tt>git read-tree -m &lt;newtree&gt;</tt> followed by a
+<tt>git checkout-index -f -u -a</tt>, the <em>git-checkout-index</em> only checks out
+the stuff that really changed.</p></div>
+<div class="para"><p>This is used to avoid unnecessary false hits when <em>git-diff-files</em> is
+run after <em>git-read-tree</em>.</p></div>
+<h3 id="_two_tree_merge">Two Tree Merge</h3><div style="clear:left"></div>
+<div class="para"><p>Typically, this is invoked as <tt>git read-tree -m $H $M</tt>, where $H
is the head commit of the current repository, and $M is the head
of a foreign tree, which is simply ahead of $H (i.e. we are in a
-fast forward situation).</p>
-<p>When two trees are specified, the user is telling <tt>git-read-tree</tt>
-the following:</p>
-<ol>
+fast forward situation).</p></div>
+<div class="para"><p>When two trees are specified, the user is telling <em>git-read-tree</em>
+the following:</p></div>
+<div class="olist"><ol>
<li>
<p>
The current index and work tree is derived from $H, but
@@ -478,10 +526,10 @@ The current index and work tree is derived from $H, but
The user wants to fast-forward to $M.
</p>
</li>
-</ol>
-<p>In this case, the <tt>git read-tree -m $H $M</tt> command makes sure
+</ol></div>
+<div class="para"><p>In this case, the <tt>git read-tree -m $H $M</tt> command makes sure
that no local change is lost as the result of this "merge".
-Here are the "carry forward" rules:</p>
+Here are the "carry forward" rules:</p></div>
<div class="literalblock">
<div class="content">
<pre><tt> I (index) H M Result
@@ -530,11 +578,11 @@ Here are the "carry forward" rules:</p>
20 yes yes no exists exists use M
21 no yes no exists exists fail</tt></pre>
</div></div>
-<p>In all "keep index" cases, the index entry stays as in the
+<div class="para"><p>In all "keep index" cases, the index entry stays as in the
original index file. If the entry were not up to date,
-<tt>git-read-tree</tt> keeps the copy in the work tree intact when
-operating under the -u flag.</p>
-<p>When this form of <tt>git-read-tree</tt> returns successfully, you can
+<em>git-read-tree</em> keeps the copy in the work tree intact when
+operating under the -u flag.</p></div>
+<div class="para"><p>When this form of <em>git-read-tree</em> returns successfully, you can
see what "local changes" you made are carried forward by running
<tt>git diff-index --cached $M</tt>. Note that this does not
necessarily match <tt>git diff-index --cached $H</tt> would have
@@ -543,27 +591,27 @@ produced before such a two tree merge. This is because of cases
you picked it up via e-mail in a patch form), <tt>git diff-index
--cached $H</tt> would have told you about the change before this
merge, but it would not show in <tt>git diff-index --cached $M</tt>
-output after two-tree merge.</p>
-<h3>3-Way Merge</h3>
-<p>Each "index" entry has two bits worth of "stage" state. stage 0 is the
-normal one, and is the only one you'd see in any kind of normal use.</p>
-<p>However, when you do <tt>git-read-tree</tt> with three trees, the "stage"
-starts out at 1.</p>
-<p>This means that you can do</p>
+output after two-tree merge.</p></div>
+<h3 id="_3_way_merge">3-Way Merge</h3><div style="clear:left"></div>
+<div class="para"><p>Each "index" entry has two bits worth of "stage" state. stage 0 is the
+normal one, and is the only one you'd see in any kind of normal use.</p></div>
+<div class="para"><p>However, when you do <em>git-read-tree</em> with three trees, the "stage"
+starts out at 1.</p></div>
+<div class="para"><p>This means that you can do</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ git read-tree -m &lt;tree1&gt; &lt;tree2&gt; &lt;tree3&gt;</tt></pre>
</div></div>
-<p>and you will end up with an index with all of the &lt;tree1&gt; entries in
+<div class="para"><p>and you will end up with an index with all of the &lt;tree1&gt; entries in
"stage1", all of the &lt;tree2&gt; entries in "stage2" and all of the
&lt;tree3&gt; entries in "stage3". When performing a merge of another
branch into the current branch, we use the common ancestor tree
as &lt;tree1&gt;, the current branch head as &lt;tree2&gt;, and the other
-branch head as &lt;tree3&gt;.</p>
-<p>Furthermore, <tt>git-read-tree</tt> has special-case logic that says: if you see
+branch head as &lt;tree3&gt;.</p></div>
+<div class="para"><p>Furthermore, <em>git-read-tree</em> has special-case logic that says: if you see
a file that matches in all respects in the following states, it
-"collapses" back to "stage0":</p>
-<ul>
+"collapses" back to "stage0":</p></div>
+<div class="ilist"><ul>
<li>
<p>
stage 2 and 3 are the same; take one or the other (it makes no
@@ -585,29 +633,29 @@ stage 1 and stage 3 are the same and stage 2 is different take
stage 2 (we did something while they did nothing)
</p>
</li>
-</ul>
-<p>The <tt>git-write-tree</tt> command refuses to write a nonsensical tree, and it
+</ul></div>
+<div class="para"><p>The <em>git-write-tree</em> command refuses to write a nonsensical tree, and it
will complain about unmerged entries if it sees a single entry that is not
-stage 0.</p>
-<p>OK, this all sounds like a collection of totally nonsensical rules,
+stage 0.</p></div>
+<div class="para"><p>OK, this all sounds like a collection of totally nonsensical rules,
but it's actually exactly what you want in order to do a fast
merge. The different stages represent the "result tree" (stage 0, aka
"merged"), the original tree (stage 1, aka "orig"), and the two trees
-you are trying to merge (stage 2 and 3 respectively).</p>
-<p>The order of stages 1, 2 and 3 (hence the order of three
+you are trying to merge (stage 2 and 3 respectively).</p></div>
+<div class="para"><p>The order of stages 1, 2 and 3 (hence the order of three
&lt;tree-ish&gt; command line arguments) are significant when you
start a 3-way merge with an index file that is already
-populated. Here is an outline of how the algorithm works:</p>
-<ul>
+populated. Here is an outline of how the algorithm works:</p></div>
+<div class="ilist"><ul>
<li>
<p>
if a file exists in identical format in all three trees, it will
- automatically collapse to "merged" state by <tt>git-read-tree</tt>.
+ automatically collapse to "merged" state by <em>git-read-tree</em>.
</p>
</li>
<li>
<p>
-a file that has _any_ difference what-so-ever in the three trees
+a file that has <em>any</em> difference what-so-ever in the three trees
will stay as separate entries in the index. It's up to "porcelain
policy" to determine how to remove the non-0 stages, and insert a
merged version.
@@ -620,7 +668,7 @@ the index file saves and restores with all this information, so you
stages 1/2/3 (i.e., "unmerged entries") you can't write the result. So
now the merge algorithm ends up being really simple:
</p>
-<ul>
+<div class="ilist"><ul>
<li>
<p>
you walk the index in order, and ignore all entries of stage 0,
@@ -642,41 +690,41 @@ if you find a matching "stage2" and "stage3" tree, you remove one
trivial rules ..
</p>
</li>
-</ul>
+</ul></div>
</li>
-</ul>
-<p>You would normally use <tt>git-merge-index</tt> with supplied
-<tt>git-merge-one-file</tt> to do this last step. The script updates
+</ul></div>
+<div class="para"><p>You would normally use <em>git-merge-index</em> with supplied
+<em>git-merge-one-file</em> to do this last step. The script updates
the files in the working tree as it merges each path and at the
-end of a successful merge.</p>
-<p>When you start a 3-way merge with an index file that is already
+end of a successful merge.</p></div>
+<div class="para"><p>When you start a 3-way merge with an index file that is already
populated, it is assumed that it represents the state of the
files in your work tree, and you can even have files with
changes unrecorded in the index file. It is further assumed
that this state is "derived" from the stage 2 tree. The 3-way
merge refuses to run if it finds an entry in the original index
-file that does not match stage 2.</p>
-<p>This is done to prevent you from losing your work-in-progress
+file that does not match stage 2.</p></div>
+<div class="para"><p>This is done to prevent you from losing your work-in-progress
changes, and mixing your random changes in an unrelated merge
commit. To illustrate, suppose you start from what has been
-committed last to your repository:</p>
+committed last to your repository:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ JC=`git rev-parse --verify "HEAD^0"`
$ git checkout-index -f -u -a $JC</tt></pre>
</div></div>
-<p>You do random edits, without running <tt>git-update-index</tt>. And then
+<div class="para"><p>You do random edits, without running <em>git-update-index</em>. And then
you notice that the tip of your "upstream" tree has advanced
-since you pulled from him:</p>
+since you pulled from him:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ git fetch git://.... linus
$ LT=`cat .git/FETCH_HEAD`</tt></pre>
</div></div>
-<p>Your work tree is still based on your HEAD ($JC), but you have
+<div class="para"><p>Your work tree is still based on your HEAD ($JC), but you have
some edits since. Three-way merge makes sure that you have not
added or modified index entries since $JC, and if you haven't,
-then does the right thing. So with the following sequence:</p>
+then does the right thing. So with the following sequence:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ git read-tree -m -u `git merge-base $JC $LT` $JC $LT
@@ -684,42 +732,42 @@ $ git merge-index git-merge-one-file -a
$ echo "Merge with Linus" | \
git commit-tree `git write-tree` -p $JC -p $LT</tt></pre>
</div></div>
-<p>what you would commit is a pure merge between $JC and $LT without
+<div class="para"><p>what you would commit is a pure merge between $JC and $LT without
your work-in-progress changes, and your work tree would be
-updated to the result of the merge.</p>
-<p>However, if you have local changes in the working tree that
-would be overwritten by this merge, <tt>git-read-tree</tt> will refuse
-to run to prevent your changes from being lost.</p>
-<p>In other words, there is no need to worry about what exists only
+updated to the result of the merge.</p></div>
+<div class="para"><p>However, if you have local changes in the working tree that
+would be overwritten by this merge, <em>git-read-tree</em> will refuse
+to run to prevent your changes from being lost.</p></div>
+<div class="para"><p>In other words, there is no need to worry about what exists only
in the working tree. When you have local changes in a part of
the project that is not involved in the merge, your changes do
not interfere with the merge, and are kept intact. When they
-<strong>do</strong> interfere, the merge does not even start (<tt>git-read-tree</tt>
+<strong>do</strong> interfere, the merge does not even start (<em>git-read-tree</em>
complains loudly and fails without modifying anything). In such
a case, you can simply continue doing what you were in the
middle of doing, and when your working tree is ready (i.e. you
-have finished your work-in-progress), attempt the merge again.</p>
+have finished your work-in-progress), attempt the merge again.</p></div>
</div>
-<h2>SEE ALSO</h2>
+<h2 id="_see_also">SEE ALSO</h2>
<div class="sectionbody">
-<p><a href="git-write-tree.html">git-write-tree(1)</a>; <a href="git-ls-files.html">git-ls-files(1)</a>;
-<a href="gitignore.html">gitignore(5)</a></p>
+<div class="para"><p><a href="git-write-tree.html">git-write-tree(1)</a>; <a href="git-ls-files.html">git-ls-files(1)</a>;
+<a href="gitignore.html">gitignore(5)</a></p></div>
</div>
-<h2>Author</h2>
+<h2 id="_author">Author</h2>
<div class="sectionbody">
-<p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;</p>
+<div class="para"><p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;</p></div>
</div>
-<h2>Documentation</h2>
+<h2 id="_documentation">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 class="para"><p>Documentation by David Greaves, Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p></div>
</div>
-<h2>GIT</h2>
+<h2 id="_git">GIT</h2>
<div class="sectionbody">
-<p>Part of the <a href="git.html">git(1)</a> suite</p>
+<div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
</div>
<div id="footer">
<div id="footer-text">
-Last updated 02-Jul-2008 03:01:57 UTC
+Last updated 2008-07-06 05:16:57 UTC
</div>
</div>
</body>