diff options
author | Junio C Hamano <junio@kernel.org> | 2010-01-13 23:09:03 +0000 |
---|---|---|
committer | Junio C Hamano <junio@kernel.org> | 2010-01-13 23:09:03 +0000 |
commit | 3c8d6708edd626aea811216a8918dcb35bda2531 (patch) | |
tree | a1ef1f4c1b3fcc2ecaa461221c63875c894ac093 /git-reset.html | |
parent | b141a92205556b5770b078237a7aa84cd5bba7e2 (diff) | |
download | git-htmldocs-3c8d6708edd626aea811216a8918dcb35bda2531.tar.gz |
Autogenerated HTML docs for v1.6.6-196-g1f735
Diffstat (limited to 'git-reset.html')
-rw-r--r-- | git-reset.html | 101 |
1 files changed, 100 insertions, 1 deletions
diff --git a/git-reset.html b/git-reset.html index 0eeee7bc0..3daa86747 100644 --- a/git-reset.html +++ b/git-reset.html @@ -418,6 +418,105 @@ HEAD.</p></div> </dd>
</dl></div>
</div>
+<h2 id="_discussion">DISCUSSION</h2>
+<div class="sectionbody">
+<div class="para"><p>The tables below show what happens when running:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>git reset --option target</tt></pre>
+</div></div>
+<div class="para"><p>to reset the HEAD to another commit (<tt>target</tt>) with the different
+reset options depending on the state of the files.</p></div>
+<div class="para"><p>In these tables, A, B, C and D are some different states of a
+file. For example, the first line of the first table means that if a
+file is in state A in the working tree, in state B in the index, in
+state C in HEAD and in state D in the target, then "git reset --soft
+target" will put the file in state A in the working tree, in state B
+in the index and in state D in HEAD.</p></div>
+<div class="literalblock">
+<div class="content">
+<pre><tt>working index HEAD target working index HEAD
+----------------------------------------------------
+ A B C D --soft A B D
+ --mixed A D D
+ --hard D D D
+ --merge (disallowed)</tt></pre>
+</div></div>
+<div class="literalblock">
+<div class="content">
+<pre><tt>working index HEAD target working index HEAD
+----------------------------------------------------
+ A B C C --soft A B C
+ --mixed A C C
+ --hard C C C
+ --merge (disallowed)</tt></pre>
+</div></div>
+<div class="literalblock">
+<div class="content">
+<pre><tt>working index HEAD target working index HEAD
+----------------------------------------------------
+ B B C D --soft B B D
+ --mixed B D D
+ --hard D D D
+ --merge D D D</tt></pre>
+</div></div>
+<div class="literalblock">
+<div class="content">
+<pre><tt>working index HEAD target working index HEAD
+----------------------------------------------------
+ B B C C --soft B B C
+ --mixed B C C
+ --hard C C C
+ --merge C C C</tt></pre>
+</div></div>
+<div class="literalblock">
+<div class="content">
+<pre><tt>working index HEAD target working index HEAD
+----------------------------------------------------
+ B C C D --soft B C D
+ --mixed B D D
+ --hard D D D
+ --merge (disallowed)</tt></pre>
+</div></div>
+<div class="literalblock">
+<div class="content">
+<pre><tt>working index HEAD target working index HEAD
+----------------------------------------------------
+ B C C C --soft B C C
+ --mixed B C C
+ --hard C C C
+ --merge B C C</tt></pre>
+</div></div>
+<div class="para"><p>"reset --merge" is meant to be used when resetting out of a conflicted
+merge. Any mergy operation guarantees that the work tree file that is
+involved in the merge does not have local change wrt the index before
+it starts, and that it writes the result out to the work tree. So if
+we see some difference between the index and the target and also
+between the index and the work tree, then it means that we are not
+resetting out from a state that a mergy operation left after failing
+with a conflict. That is why we disallow --merge option in this case.</p></div>
+<div class="para"><p>The following tables show what happens when there are unmerged
+entries:</p></div>
+<div class="literalblock">
+<div class="content">
+<pre><tt>working index HEAD target working index HEAD
+----------------------------------------------------
+ X U A B --soft (disallowed)
+ --mixed X B B
+ --hard B B B
+ --merge B B B</tt></pre>
+</div></div>
+<div class="literalblock">
+<div class="content">
+<pre><tt>working index HEAD target working index HEAD
+----------------------------------------------------
+ X U A A --soft (disallowed)
+ --mixed X A A
+ --hard A A A
+ --merge A A A</tt></pre>
+</div></div>
+<div class="para"><p>X means any state and U means an unmerged index.</p></div>
+</div>
<h2 id="_examples">Examples</h2>
<div class="sectionbody">
<div class="vlist"><dl>
@@ -721,7 +820,7 @@ Adds the file to the index again. </div>
<div id="footer">
<div id="footer-text">
-Last updated 2010-01-10 19:52:59 UTC
+Last updated 2010-01-13 23:08:42 UTC
</div>
</div>
</body>
|