stash: replace "git stash save" with "git stash push" in the documentation
"git stash push" is the newer interface for creating a stash. While we are still keeping "git stash save" around for the time being, it's better to point new users of "git stash" to the more modern (and more feature rich) interface, instead of teaching them the older version that we might want to phase out in the future. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Gummerer committed
Oct 22, 2017 at 18:04 UTC
db37745eef62c57e1609cbd50c6dbf9a8066f191
4 files changed
+13
-13
Documentation/git-stash.txt
+6
-6
@@ -33,7 +33,7 @@ and reverts the working directory to match the `HEAD` commit.
33
The modifications stashed away by this command can be listed with
34
`git stash list`, inspected with `git stash show`, and restored
35
(potentially on top of a different commit) with `git stash apply`.
36
-Calling `git stash` without any arguments is equivalent to `git stash save`.
36
+Calling `git stash` without any arguments is equivalent to `git stash push`.
37
A stash is by default listed as "WIP on 'branchname' ...", but
38
you can give a more descriptive message on the command line when
39
you create one.
@@ -118,7 +118,7 @@ pop [--index] [-q|--quiet] [<stash>]::
118
119
Remove a single stashed state from the stash list and apply it
120
on top of the current working tree state, i.e., do the inverse
121
- operation of `git stash save`. The working directory must
121
+ operation of `git stash push`. The working directory must
122
match the index.
123
+
124
Applying the state can fail with conflicts; in this case, it is not
@@ -137,7 +137,7 @@ apply [--index] [-q|--quiet] [<stash>]::
137
138
Like `pop`, but do not remove the state from the stash list. Unlike `pop`,
139
`<stash>` may be any commit that looks like a commit created by
140
- `stash save` or `stash create`.
140
+ `stash push` or `stash create`.
141
142
branch <branchname> [<stash>]::
143
@@ -148,7 +148,7 @@ branch <branchname> [<stash>]::
148
`stash@{<revision>}`, it then drops the `<stash>`. When no `<stash>`
149
is given, applies the latest one.
150
+
151
-This is useful if the branch on which you ran `git stash save` has
151
+This is useful if the branch on which you ran `git stash push` has
152
changed enough that `git stash apply` fails due to conflicts. Since
153
the stash entry is applied on top of the commit that was HEAD at the
154
time `git stash` was run, it restores the originally stashed state
@@ -255,14 +255,14 @@ $ git stash pop
255
256
Testing partial commits::
257
258
-You can use `git stash save --keep-index` when you want to make two or
258
+You can use `git stash push --keep-index` when you want to make two or
259
more commits out of the changes in the work tree, and you want to test
260
each change before committing:
261
+
262
----------------------------------------------------------------
263
# ... hack hack hack ...
264
$ git add --patch foo # add just first part to the index
265
-$ git stash save --keep-index # save all other changes to the stash
265
+$ git stash push --keep-index # save all other changes to the stash
266
$ edit/build/test first part
267
$ git commit -m 'First part' # commit fully tested change
268
$ git stash pop # prepare to work on all other changes
Documentation/gitworkflows.txt
+1
-1
@@ -40,7 +40,7 @@ beginning. It is always easier to squash a few commits together than
40
to split one big commit into several. Don't be afraid of making too
41
small or imperfect steps along the way. You can always go back later
42
and edit the commits with `git rebase --interactive` before you
43
-publish them. You can use `git stash save --keep-index` to run the
43
+publish them. You can use `git stash push --keep-index` to run the
44
test suite independent of other uncommitted changes; see the EXAMPLES
45
section of linkgit:git-stash[1].
46
Documentation/user-manual.txt
+1
-1
@@ -1556,7 +1556,7 @@ so on a different branch and then coming back), unstash the
1556
work-in-progress changes.
1557
1558
------------------------------------------------
1559
-$ git stash save "work in progress for foo feature"
1559
+$ git stash push -m "work in progress for foo feature"
1560
------------------------------------------------
1561
1562
This command will save your changes away to the `stash`, and
git-stash.sh
+5
-5
@@ -267,11 +267,11 @@ push_stash () {
267
# translation of "error: " takes in your language. E.g. in
268
# English this is:
269
#
270
- # $ git stash save --blah-blah 2>&1 | head -n 2
271
- # error: unknown option for 'stash save': --blah-blah
272
- # To provide a message, use git stash save -- '--blah-blah'
273
- eval_gettextln "error: unknown option for 'stash save': \$option
274
- To provide a message, use git stash save -- '\$option'"
270
+ # $ git stash push --blah-blah 2>&1 | head -n 2
271
+ # error: unknown option for 'stash push': --blah-blah
272
+ # To provide a message, use git stash push -m '--blah-blah'
273
+ eval_gettextln "error: unknown option for 'stash push': \$option
274
+ To provide a message, use git stash push -m '\$option'"
275
usage
276
;;
277
*)