summaryrefslogtreecommitdiffstats
path: root/git-reset.html
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-01-17 14:46:49 -0800
committerJunio C Hamano <gitster@pobox.com>2014-01-17 14:46:49 -0800
commit61525f915b47e953b4288a9afcee45e47b352214 (patch)
treef0649f89cc7a77c0296305f4673fc2bc7e0a6d54 /git-reset.html
parentbc8d4783cac3c942fc9e8cf2f3eae4aea8cab5cb (diff)
downloadgit-htmldocs-61525f915b47e953b4288a9afcee45e47b352214.tar.gz
Autogenerated HTML docs for v1.9-rc0
Diffstat (limited to 'git-reset.html')
-rw-r--r--git-reset.html114
1 files changed, 59 insertions, 55 deletions
diff --git a/git-reset.html b/git-reset.html
index afc6b97e2..1a2035482 100644
--- a/git-reset.html
+++ b/git-reset.html
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
-<meta name="generator" content="AsciiDoc 8.6.8" />
+<meta name="generator" content="AsciiDoc 8.6.6" />
<title>git-reset(1)</title>
<style type="text/css">
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
@@ -87,15 +87,11 @@ ul, ol, li > p {
ul > li { color: #aaa; }
ul > li > * { color: black; }
-.monospaced, code, pre {
- font-family: "Courier New", Courier, monospace;
- font-size: inherit;
- color: navy;
+pre {
padding: 0;
margin: 0;
}
-
#author {
color: #527bbd;
font-weight: bold;
@@ -353,7 +349,7 @@ div.colist td img {
margin-bottom: 0.1em;
}
-div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
+div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
margin-top: 0;
margin-bottom: 0;
}
@@ -411,14 +407,18 @@ span.underline { text-decoration: underline; }
span.overline { text-decoration: overline; }
span.line-through { text-decoration: line-through; }
-div.unbreakable { page-break-inside: avoid; }
-
/*
* xhtml11 specific
*
* */
+tt {
+ font-family: monospace;
+ font-size: inherit;
+ color: navy;
+}
+
div.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
@@ -452,6 +452,12 @@ div.tableblock > table[frame="vsides"] {
*
* */
+.monospaced {
+ font-family: monospace;
+ font-size: inherit;
+ color: navy;
+}
+
table.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
@@ -531,8 +537,6 @@ body.manpage div.sectionbody {
@media print {
body.manpage div#toc { display: none; }
}
-
-
</style>
<script type="text/javascript">
/*<![CDATA[*/
@@ -577,7 +581,7 @@ toc: function (toclevels) {
function tocEntries(el, toclevels) {
var result = new Array;
- var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
+ var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
// Function that scans the DOM tree for header elements (the DOM2
// nodeIterator API would be a better technique but not supported by all
// browsers).
@@ -606,7 +610,7 @@ toc: function (toclevels) {
var i;
for (i = 0; i < toc.childNodes.length; i++) {
var entry = toc.childNodes[i];
- if (entry.nodeName.toLowerCase() == 'div'
+ if (entry.nodeName == 'div'
&& entry.getAttribute("class")
&& entry.getAttribute("class").match(/^toclevel/))
tocEntriesToRemove.push(entry);
@@ -652,7 +656,7 @@ footnotes: function () {
var entriesToRemove = [];
for (i = 0; i < noteholder.childNodes.length; i++) {
var entry = noteholder.childNodes[i];
- if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
+ if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")
entriesToRemove.push(entry);
}
for (i = 0; i < entriesToRemove.length; i++) {
@@ -770,9 +774,9 @@ to HEAD in all forms.</p></div>
state at &lt;tree-ish&gt;. (It does not affect the working tree, nor
the current branch.)
</p>
-<div class="paragraph"><p>This means that <code>git reset &lt;paths&gt;</code> is the opposite of <code>git add
-&lt;paths&gt;</code>.</p></div>
-<div class="paragraph"><p>After running <code>git reset &lt;paths&gt;</code> to update the index entry, you can
+<div class="paragraph"><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="paragraph"><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
@@ -788,9 +792,9 @@ working tree in one go.</p></div>
and &lt;tree-ish&gt; (defaults to HEAD). The chosen hunks are applied
in reverse to the index.
</p>
-<div class="paragraph"><p>This means that <code>git reset -p</code> is the opposite of <code>git add -p</code>, i.e.
+<div class="paragraph"><p>This means that <tt>git reset -p</tt> is the opposite of <tt>git add -p</tt>, i.e.
you can use it to selectively reset hunks. See the &#8220;Interactive Mode&#8221;
-section of <a href="git-add.html">git-add(1)</a> to learn how to operate the <code>--patch</code> mode.</p></div>
+section of <a href="git-add.html">git-add(1)</a> to learn how to operate the <tt>--patch</tt> mode.</p></div>
</dd>
<dt class="hdlist1">
<em>git reset</em> [&lt;mode&gt;] [&lt;commit&gt;]
@@ -897,11 +901,11 @@ Undo add
<dd>
<div class="listingblock">
<div class="content">
-<pre><code>$ edit <b>&lt;1&gt;</b>
+<pre><tt>$ edit <b>&lt;1&gt;</b>
$ git add frotz.c filfre.c
$ mailx <b>&lt;2&gt;</b>
$ git reset <b>&lt;3&gt;</b>
-$ git pull git://info.example.com/ nitfol <b>&lt;4&gt;</b></code></pre>
+$ git pull git://info.example.com/ nitfol <b>&lt;4&gt;</b></tt></pre>
</div></div>
<div class="colist arabic"><ol>
<li>
@@ -940,10 +944,10 @@ Undo a commit and redo
<dd>
<div class="listingblock">
<div class="content">
-<pre><code>$ git commit ...
+<pre><tt>$ git commit ...
$ git reset --soft HEAD^ <b>&lt;1&gt;</b>
$ edit <b>&lt;2&gt;</b>
-$ git commit -a -c ORIG_HEAD <b>&lt;3&gt;</b></code></pre>
+$ git commit -a -c ORIG_HEAD <b>&lt;3&gt;</b></tt></pre>
</div></div>
<div class="colist arabic"><ol>
<li>
@@ -974,9 +978,9 @@ Undo a commit, making it a topic branch
<dd>
<div class="listingblock">
<div class="content">
-<pre><code>$ git branch topic/wip <b>&lt;1&gt;</b>
+<pre><tt>$ git branch topic/wip <b>&lt;1&gt;</b>
$ git reset --hard HEAD~3 <b>&lt;2&gt;</b>
-$ git checkout topic/wip <b>&lt;3&gt;</b></code></pre>
+$ git checkout topic/wip <b>&lt;3&gt;</b></tt></pre>
</div></div>
<div class="colist arabic"><ol>
<li>
@@ -1005,8 +1009,8 @@ Undo commits permanently
<dd>
<div class="listingblock">
<div class="content">
-<pre><code>$ git commit ...
-$ git reset --hard HEAD~3 <b>&lt;1&gt;</b></code></pre>
+<pre><tt>$ git commit ...
+$ git reset --hard HEAD~3 <b>&lt;1&gt;</b></tt></pre>
</div></div>
<div class="colist arabic"><ol>
<li>
@@ -1026,7 +1030,7 @@ Undo a merge or pull
<dd>
<div class="listingblock">
<div class="content">
-<pre><code>$ git pull <b>&lt;1&gt;</b>
+<pre><tt>$ git pull <b>&lt;1&gt;</b>
Auto-merging nitfol
CONFLICT (content): Merge conflict in nitfol
Automatic merge failed; fix conflicts and then commit the result.
@@ -1034,7 +1038,7 @@ $ git reset --hard <b>&lt;2&gt;</b>
$ git pull . topic/branch <b>&lt;3&gt;</b>
Updating from 41223... to 13134...
Fast-forward
-$ git reset --hard ORIG_HEAD <b>&lt;4&gt;</b></code></pre>
+$ git reset --hard ORIG_HEAD <b>&lt;4&gt;</b></tt></pre>
</div></div>
<div class="colist arabic"><ol>
<li>
@@ -1074,12 +1078,12 @@ Undo a merge or pull inside a dirty working tree
<dd>
<div class="listingblock">
<div class="content">
-<pre><code>$ git pull <b>&lt;1&gt;</b>
+<pre><tt>$ git pull <b>&lt;1&gt;</b>
Auto-merging nitfol
Merge made by recursive.
nitfol | 20 +++++----
...
-$ git reset --merge ORIG_HEAD <b>&lt;2&gt;</b></code></pre>
+$ git reset --merge ORIG_HEAD <b>&lt;2&gt;</b></tt></pre>
</div></div>
<div class="colist arabic"><ol>
<li>
@@ -1111,7 +1115,7 @@ working tree are not in any shape to be committed yet, but you
need to get to the other branch for a quick bugfix.</p></div>
<div class="listingblock">
<div class="content">
-<pre><code>$ git checkout feature ;# you were working in "feature" branch and
+<pre><tt>$ git checkout feature ;# you were working in "feature" branch and
$ work work work ;# got interrupted
$ git commit -a -m "snapshot WIP" <b>&lt;1&gt;</b>
$ git checkout master
@@ -1119,7 +1123,7 @@ $ fix fix fix
$ git commit ;# commit with real log
$ git checkout feature
$ git reset --soft HEAD^ ;# go back to WIP state <b>&lt;2&gt;</b>
-$ git reset <b>&lt;3&gt;</b></code></pre>
+$ git reset <b>&lt;3&gt;</b></tt></pre>
</div></div>
<div class="colist arabic"><ol>
<li>
@@ -1152,9 +1156,9 @@ want to add it to your commit. You can remove the file from the index
while keeping your changes with git reset.</p></div>
<div class="listingblock">
<div class="content">
-<pre><code>$ git reset -- frotz.c <b>&lt;1&gt;</b>
+<pre><tt>$ git reset -- frotz.c <b>&lt;1&gt;</b>
$ git commit -m "Commit files in index" <b>&lt;2&gt;</b>
-$ git add frotz.c <b>&lt;3&gt;</b></code></pre>
+$ git add frotz.c <b>&lt;3&gt;</b></tt></pre>
</div></div>
<div class="colist arabic"><ol>
<li>
@@ -1186,13 +1190,13 @@ with what you committed previously. You can start a new branch and
reset it while keeping the changes in your working tree.</p></div>
<div class="listingblock">
<div class="content">
-<pre><code>$ git tag start
+<pre><tt>$ git tag start
$ git checkout -b branch1
$ edit
$ git commit ... <b>&lt;1&gt;</b>
$ edit
$ git checkout -b branch2 <b>&lt;2&gt;</b>
-$ git reset --keep start <b>&lt;3&gt;</b></code></pre>
+$ git reset --keep start <b>&lt;3&gt;</b></tt></pre>
</div></div>
<div class="colist arabic"><ol>
<li>
@@ -1225,9 +1229,9 @@ But you can use "reset --keep" to remove the unwanted commit after
<div class="paragraph"><p>The tables below show what happens when running:</p></div>
<div class="listingblock">
<div class="content">
-<pre><code>git reset --option target</code></pre>
+<pre><tt>git reset --option target</tt></pre>
</div></div>
-<div class="paragraph"><p>to reset the HEAD to another commit (<code>target</code>) with the different
+<div class="paragraph"><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="paragraph"><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
@@ -1239,63 +1243,63 @@ 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><code>working index HEAD target working index HEAD
+<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)
- --keep (disallowed)</code></pre>
+ --keep (disallowed)</tt></pre>
</div></div>
<div class="literalblock">
<div class="content">
-<pre><code>working index HEAD target working index HEAD
+<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)
- --keep A C C</code></pre>
+ --keep A C C</tt></pre>
</div></div>
<div class="literalblock">
<div class="content">
-<pre><code>working index HEAD target working index HEAD
+<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
- --keep (disallowed)</code></pre>
+ --keep (disallowed)</tt></pre>
</div></div>
<div class="literalblock">
<div class="content">
-<pre><code>working index HEAD target working index HEAD
+<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
- --keep B C C</code></pre>
+ --keep B C C</tt></pre>
</div></div>
<div class="literalblock">
<div class="content">
-<pre><code>working index HEAD target working index HEAD
+<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)
- --keep (disallowed)</code></pre>
+ --keep (disallowed)</tt></pre>
</div></div>
<div class="literalblock">
<div class="content">
-<pre><code>working index HEAD target working index HEAD
+<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
- --keep B C C</code></pre>
+ --keep B C C</tt></pre>
</div></div>
<div class="paragraph"><p>"reset --merge" is meant to be used when resetting out of a conflicted
merge. Any mergy operation guarantees that the working tree file that is
@@ -1317,23 +1321,23 @@ entries.</p></div>
entries:</p></div>
<div class="literalblock">
<div class="content">
-<pre><code>working index HEAD target working index HEAD
+<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
- --keep (disallowed)</code></pre>
+ --keep (disallowed)</tt></pre>
</div></div>
<div class="literalblock">
<div class="content">
-<pre><code>working index HEAD target working index HEAD
+<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
- --keep (disallowed)</code></pre>
+ --keep (disallowed)</tt></pre>
</div></div>
<div class="paragraph"><p>X means any state and U means an unmerged index.</p></div>
</div>