summaryrefslogtreecommitdiff
path: root/Documentation/git-stash.txt
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-07-13 15:16:09 -0700
committerJunio C Hamano <gitster@pobox.com>2008-07-13 15:16:09 -0700
commit671d3220359145edd1002dc0afe76bc5782597f3 (patch)
treed79dad70ad5ae378362aec6d4d3b1c8f12f02c60 /Documentation/git-stash.txt
parent15fc1c02fce2ee6a8a3f625bf24dd782fd905904 (diff)
parent4a588075c54cd5902e5f4d43b9d6b0c31d0f9769 (diff)
downloadgit-671d3220359145edd1002dc0afe76bc5782597f3.tar.gz
Merge branch 'am/stash-branch'
* am/stash-branch: Add a test for "git stash branch" Implement "git stash branch <newbranch> <stash>"
Diffstat (limited to 'Documentation/git-stash.txt')
-rw-r--r--Documentation/git-stash.txt19
1 files changed, 18 insertions, 1 deletions
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index e42c5eff4d..7d50d74cc9 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -8,8 +8,11 @@ git-stash - Stash the changes in a dirty working directory away
SYNOPSIS
--------
[verse]
-'git stash' (list | show [<stash>] | apply [<stash>] | clear | drop [<stash>] | pop [<stash>])
+'git stash' list
+'git stash' (show | apply | drop | pop ) [<stash>]
+'git stash' branch <branchname> [<stash>]
'git stash' [save [<message>]]
+'git stash' clear
DESCRIPTION
-----------
@@ -84,6 +87,20 @@ tree's changes, but also the index's ones. However, this can fail, when you
have conflicts (which are stored in the index, where you therefore can no
longer apply the changes as they were originally).
+branch <branchname> [<stash>]::
+
+ Creates and checks out a new branch named `<branchname>` starting from
+ the commit at which the `<stash>` was originally created, applies the
+ changes recorded in `<stash>` to the new working tree and index, then
+ drops the `<stash>` if that completes successfully. When no `<stash>`
+ is given, applies the latest one.
++
+This is useful if the branch on which you ran `git stash save` has
+changed enough that `git stash apply` fails due to conflicts. Since
+the stash is applied on top of the commit that was HEAD at the time
+`git stash` was run, it restores the originally stashed state with
+no conflicts.
+
clear::
Remove all the stashed states. Note that those states will then
be subject to pruning, and may be difficult or impossible to recover.