Skip to content

Commit b0c6bf4

Browse files
jonseymourgitster
authored andcommitted
detached-stash: update Documentation
Update the documentation to indicate that git stash branch only attempts to drop the specified stash if it looks like stash reference. Also changed the synopsis to more clearly indicate which commands require a stash entry reference as opposed to merely a stash-like commit. Signed-off-by: Jon Seymour <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent daf7a0c commit b0c6bf4

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Documentation/git-stash.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,22 @@ tree's changes, but also the index's ones. However, this can fail, when you
104104
have conflicts (which are stored in the index, where you therefore can no
105105
longer apply the changes as they were originally).
106106
+
107-
When no `<stash>` is given, `stash@\{0}` is assumed.
107+
When no `<stash>` is given, `stash@\{0}` is assumed, otherwise `<stash>` must
108+
be a reference of the form `stash@\{<revision>}`.
108109

109110
apply [--index] [-q|--quiet] [<stash>]::
110111

111-
Like `pop`, but do not remove the state from the stash list.
112+
Like `pop`, but do not remove the state from the stash list. Unlike `pop`,
113+
`<stash>` may be any commit that looks like a commit created by
114+
`stash save` or `stash create`.
112115

113116
branch <branchname> [<stash>]::
114117

115118
Creates and checks out a new branch named `<branchname>` starting from
116119
the commit at which the `<stash>` was originally created, applies the
117-
changes recorded in `<stash>` to the new working tree and index, then
118-
drops the `<stash>` if that completes successfully. When no `<stash>`
120+
changes recorded in `<stash>` to the new working tree and index.
121+
If that succeeds, and `<stash>` is a reference of the form
122+
`stash@{<revision>}`, it then drops the `<stash>`. When no `<stash>`
119123
is given, applies the latest one.
120124
+
121125
This is useful if the branch on which you ran `git stash save` has
@@ -132,7 +136,9 @@ clear::
132136
drop [-q|--quiet] [<stash>]::
133137

134138
Remove a single stashed state from the stash list. When no `<stash>`
135-
is given, it removes the latest one. i.e. `stash@\{0}`
139+
is given, it removes the latest one. i.e. `stash@\{0}`, otherwise
140+
`<stash>` must a valid stash log reference of the form
141+
`stash@\{<revision>}`.
136142

137143
create::
138144

0 commit comments

Comments
 (0)