summaryrefslogtreecommitdiffstats
path: root/git-reset.html
diff options
context:
space:
mode:
authorJunio C Hamano <junio@kernel.org>2010-10-07 00:01:24 +0000
committerJunio C Hamano <junio@kernel.org>2010-10-07 00:01:24 +0000
commit657fd8a8dd93c9d5c7534016aa6601c564fe2601 (patch)
tree634630bc99c2a4c8de534924544ac14d34b473ca /git-reset.html
parent0fd857e5bc36d9b8c88686a602c4ae253607487b (diff)
downloadgit-htmldocs-657fd8a8dd93c9d5c7534016aa6601c564fe2601.tar.gz
Autogenerated HTML docs for v1.7.3.1-104-gc752e
Diffstat (limited to 'git-reset.html')
-rw-r--r--git-reset.html75
1 files changed, 45 insertions, 30 deletions
diff --git a/git-reset.html b/git-reset.html
index 0711897bd..45d5f4c16 100644
--- a/git-reset.html
+++ b/git-reset.html
@@ -328,8 +328,8 @@ git-reset(1) Manual Page
<h2 id="_description">DESCRIPTION</h2>
<div class="sectionbody">
<div class="para"><p>In the first and second form, copy entries from &lt;commit&gt; to the index.
-In the third form, set the current branch to &lt;commit&gt;, optionally
-modifying index and worktree to match. The &lt;commit&gt; defaults to HEAD
+In the third form, set the current branch head (HEAD) to &lt;commit&gt;, optionally
+modifying index and working tree to match. The &lt;commit&gt; defaults to HEAD
in all forms.</p></div>
<div class="vlist"><dl>
<dt>
@@ -338,11 +338,17 @@ in all forms.</p></div>
<dd>
<p>
This form resets the index entries for all &lt;paths&gt; to their
- state at the &lt;commit&gt;. (It does not affect the worktree, nor
+ state at &lt;commit&gt;. (It does not affect the working tree, nor
the current branch.)
</p>
<div class="para"><p>This means that <tt>git reset &lt;paths&gt;</tt> is the opposite of <tt>git add
&lt;paths&gt;</tt>.</p></div>
+<div class="para"><p>After running <tt>git reset &lt;paths&gt;</tt> to update the index entry, you can
+use <a href="git-checkout.html">git-checkout(1)</a> to check the contents out of the index to
+the working tree.
+Alternatively, using <a href="git-checkout.html">git-checkout(1)</a> and specifying a commit, you
+can copy the contents of a path out of a commit to the index and to the
+working tree in one go.</p></div>
</dd>
<dt>
<em>git reset</em> --patch|-p [&lt;commit&gt;] [--] [&lt;paths&gt;&#8230;]
@@ -361,9 +367,10 @@ in all forms.</p></div>
</dt>
<dd>
<p>
- This form points the current branch to &lt;commit&gt; and then
- updates index and working tree according to &lt;mode&gt;, which must
- be one of the following:
+ This form resets the current branch head to &lt;commit&gt; and
+ possibly updates the index (resetting it to the tree of &lt;commit&gt;) and
+ the working tree depending on &lt;mode&gt;, which
+ must be one of the following:
</p>
<div class="vlist"><dl>
<dt>
@@ -371,10 +378,10 @@ in all forms.</p></div>
</dt>
<dd>
<p>
- Does not touch the index file nor the working tree at all, but
- requires them to be in a good order. This leaves all your changed
- files "Changes to be committed", as <em>git status</em> would
- put it.
+ Does not touch the index file nor the working tree at all (but
+ resets the head to &lt;commit&gt;, just like all modes do). This leaves
+ all your changed files "Changes to be committed", as <em>git status</em>
+ would put it.
</p>
</dd>
<dt>
@@ -392,9 +399,8 @@ in all forms.</p></div>
</dt>
<dd>
<p>
- Matches the working tree and index to that of the tree being
- switched to. Any changes to tracked files in the working tree
- since &lt;commit&gt; are lost.
+ Resets the index and working tree. Any changes to tracked files in the
+ working tree since &lt;commit&gt; are discarded.
</p>
</dd>
<dt>
@@ -402,9 +408,14 @@ in all forms.</p></div>
</dt>
<dd>
<p>
- Resets the index to match the tree recorded by the named commit,
- and updates the files that are different between the named commit
- and the current commit in the working tree.
+ Resets the index and updates the files in the working tree that are
+ different between &lt;commit&gt; and HEAD, but keeps those which are
+ different between the index and working tree (i.e. which have changes
+ which have not been added).
+ If a file that is different between &lt;commit&gt; and the index has unstaged
+ changes, reset is aborted.<br />
+In other words, --merge does something like a <em>git read-tree -u -m &lt;commit&gt;</em>,
+but carries forward unmerged index entries.
</p>
</dd>
<dt>
@@ -412,12 +423,14 @@ in all forms.</p></div>
</dt>
<dd>
<p>
- Reset the index to the given commit, keeping local changes in
- the working tree since the current commit, while updating
- working tree files without local changes to what appears in
- the given commit. If a file that is different between the
- current commit and the given commit has local changes, reset
- is aborted.
+ Resets the index, updates files in the working tree that are
+ different between &lt;commit&gt; and HEAD, but keeps those
+ which are different between HEAD and the working tree (i.e.
+ which have local changes).
+ If a file that is different between &lt;commit&gt; and HEAD has local changes,
+ reset is aborted.<br />
+In other words, --keep does a 2-way merge between &lt;commit&gt; and HEAD followed by
+<em>git reset --mixed &lt;commit&gt;</em>.
</p>
</dd>
</dl></div>
@@ -623,7 +636,7 @@ and resets the tip of the branch to that commit.
</ol></div>
</dd>
<dt>
-Undo a merge or pull inside a dirty work tree
+Undo a merge or pull inside a dirty working tree
</dt>
<dd>
<div class="listingblock">
@@ -737,7 +750,7 @@ Keep changes in working tree while discarding some previous commits
continue working a bit more, but now you think that what you have in
your working tree should be in another branch that has nothing to do
with what you committed previously. You can start a new branch and
-reset it while keeping the changes in your work tree.</p></div>
+reset it while keeping the changes in your working tree.</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ git tag start
@@ -785,8 +798,10 @@ reset options depending on the state of the files.</p></div>
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>
+target" will leave the file in the working tree in state A and in the
+index in state B. It resets (i.e. moves) the HEAD (i.e. the tip of
+the current branch, if you are on one) to "target" (which has the file
+in state D).</p></div>
<div class="literalblock">
<div class="content">
<pre><tt>working index HEAD target working index HEAD
@@ -848,11 +863,11 @@ in the index and in state D in HEAD.</p></div>
--keep 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
+merge. Any mergy operation guarantees that the working 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
+it starts, and that it writes the result out to the working 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
+between the index and the working 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>"reset --keep" is meant to be used when removing some of the last
@@ -901,7 +916,7 @@ entries:</p></div>
</div>
<div id="footer">
<div id="footer-text">
-Last updated 2010-09-18 23:56:55 UTC
+Last updated 2010-10-07 00:00:53 UTC
</div>
</div>
</body>