diff options
author | Junio C Hamano <junio@hera.kernel.org> | 2008-07-14 03:13:27 +0000 |
---|---|---|
committer | Junio C Hamano <junio@hera.kernel.org> | 2008-07-14 03:13:27 +0000 |
commit | 46a38aa8be7b8f7b5afdeeea0744859b3e03d5a2 (patch) | |
tree | 109cac450de2a01929e22f1db123b486d14a7d25 /git-stash.html | |
parent | 208beb7160e9d42ed3938d959525e6d89c642e39 (diff) | |
download | git-htmldocs-46a38aa8be7b8f7b5afdeeea0744859b3e03d5a2.tar.gz |
Autogenerated HTML docs for v1.5.6.3-315-g10ce0
Diffstat (limited to 'git-stash.html')
-rw-r--r-- | git-stash.html | 52 |
1 files changed, 48 insertions, 4 deletions
diff --git a/git-stash.html b/git-stash.html index 97aa37e21..9e61785f4 100644 --- a/git-stash.html +++ b/git-stash.html @@ -321,8 +321,11 @@ git-stash(1) Manual Page <h2>SYNOPSIS</h2>
<div class="sectionbody">
<div class="verseblock">
-<div class="content"><em>git stash</em> (list | show [<stash>] | apply [<stash>] | clear | drop [<stash>] | pop [<stash>])
-<em>git stash</em> [save [<message>]]</div></div>
+<div class="content"><em>git stash</em> list
+<em>git stash</em> (show | apply | drop | pop ) [<stash>]
+<em>git stash</em> branch <branchname> [<stash>]
+<em>git stash</em> [save [<message>]]
+<em>git stash</em> clear</div></div>
</div>
<h2 id="_description">DESCRIPTION</h2>
<div class="sectionbody">
@@ -347,7 +350,7 @@ is also possible).</p></div> <div class="sectionbody">
<div class="vlist"><dl>
<dt>
-save [<message>]
+save [--keep-index] [<message>]
</dt>
<dd>
<p>
@@ -356,6 +359,8 @@ save [<message>] subcommand is given. The <message> part is optional and gives
the description along with the stashed state.
</p>
+<div class="para"><p>If the <tt>--keep-index</tt> option is used, all changes already added to the
+index are left intact.</p></div>
</dd>
<dt>
list [<options>]
@@ -405,6 +410,23 @@ have conflicts (which are stored in the index, where you therefore can no longer apply the changes as they were originally).</p></div>
</dd>
<dt>
+branch <branchname> [<stash>]
+</dt>
+<dd>
+<p>
+ Creates and checks out a new branch named <tt><branchname></tt> starting from
+ the commit at which the <tt><stash></tt> was originally created, applies the
+ changes recorded in <tt><stash></tt> to the new working tree and index, then
+ drops the <tt><stash></tt> if that completes successfully. When no <tt><stash></tt>
+ is given, applies the latest one.
+</p>
+<div class="para"><p>This is useful if the branch on which you ran <tt>git stash save</tt> has
+changed enough that <tt>git stash apply</tt> fails due to conflicts. Since
+the stash is applied on top of the commit that was HEAD at the time
+<tt>git stash</tt> was run, it restores the originally stashed state with
+no conflicts.</p></div>
+</dd>
+<dt>
clear
</dt>
<dd>
@@ -511,6 +533,28 @@ $ git stash apply ... continue hacking ...</tt></pre>
</div></div>
</dd>
+<dt>
+Testing partial commits
+</dt>
+<dd>
+<p>
+You can use <tt>git stash save --keep-index</tt> when you want to make two or
+more commits out of the changes in the work tree, and you want to test
+each change before committing:
+</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>... hack hack hack ...
+$ git add --patch foo # add just first part to the index
+$ git stash save --keep-index # save all other changes to the stash
+$ edit/build/test first part
+$ git commit foo -m 'First part' # commit fully tested change
+$ git stash pop # prepare to work on all other changes
+... repeat above five steps until one commit remains ...
+$ edit/build/test remaining parts
+$ git commit foo -m 'Remaining parts'</tt></pre>
+</div></div>
+</dd>
</dl></div>
</div>
<h2 id="_see_also">SEE ALSO</h2>
@@ -530,7 +574,7 @@ $ git stash apply </div>
<div id="footer">
<div id="footer-text">
-Last updated 2008-07-06 05:17:03 UTC
+Last updated 2008-07-14 03:12:31 UTC
</div>
</div>
</body>
|