summaryrefslogtreecommitdiff
path: root/Documentation/git-stash.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/git-stash.txt')
-rw-r--r--Documentation/git-stash.txt34
1 files changed, 18 insertions, 16 deletions
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index 051f94d..a42d4c8 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -9,8 +9,8 @@ SYNOPSIS
--------
[verse]
'git stash' list [<options>]
-'git stash' (show | drop | pop ) [<stash>]
-'git stash' apply [--index] [<stash>]
+'git stash' ( show | drop ) [<stash>]
+'git stash' ( pop | apply ) [--index] [<stash>]
'git stash' branch <branchname> [<stash>]
'git stash' [save [--keep-index] [<message>]]
'git stash' clear
@@ -75,19 +75,27 @@ show [<stash>]::
it will accept any format known to 'git-diff' (e.g., `git stash show
-p stash@\{1}` to view the second most recent stash in patch form).
-apply [--index] [<stash>]::
+pop [<stash>]::
- Restore the changes recorded in the stash on top of the current
- working tree state. When no `<stash>` is given, applies the latest
- one. The working directory must match the index.
+ Remove a single stashed state from the stash list and apply it
+ on top of the current working tree state, i.e., do the inverse
+ operation of `git stash save`. The working directory must
+ match the index.
+
-This operation can fail with conflicts; you need to resolve them
-by hand in the working tree.
+Applying the state can fail with conflicts; in this case, it is not
+removed from the stash list. You need to resolve the conflicts by hand
+and call `git stash drop` manually afterwards.
+
If the `--index` option is used, then tries to reinstate not only the working
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).
++
+When no `<stash>` is given, `stash@\{0}` is assumed.
+
+apply [--index] [<stash>]::
+
+ Like `pop`, but do not remove the state from the stash list.
branch <branchname> [<stash>]::
@@ -112,12 +120,6 @@ drop [<stash>]::
Remove a single stashed state from the stash list. When no `<stash>`
is given, it removes the latest one. i.e. `stash@\{0}`
-pop [<stash>]::
-
- Remove a single stashed state from the stash list and apply on top
- of the current working tree state. When no `<stash>` is given,
- `stash@\{0}` is assumed. See also `apply`.
-
create::
Create a stash (which is a regular commit object) and return its
@@ -163,7 +165,7 @@ $ git pull
file foobar not up to date, cannot merge.
$ git stash
$ git pull
-$ git stash apply
+$ git stash pop
----------------------------------------------------------------
Interrupted workflow::
@@ -192,7 +194,7 @@ You can use 'git-stash' to simplify the above, like this:
$ git stash
$ edit emergency fix
$ git commit -a -m "Fix in a hurry"
-$ git stash apply
+$ git stash pop
# ... continue hacking ...
----------------------------------------------------------------