Skip to content

Commit 40f1293

Browse files
committed
Merge branch 'tg/deprecate-stash-save'
"git stash save" has been deprecated in favour of "git stash push". * tg/deprecate-stash-save: stash: remove now superfluos help for "stash push" stash: mark "git stash save" deprecated in the man page stash: replace "git stash save" with "git stash push" in the documentation
2 parents 30af513 + c0c0c82 commit 40f1293

File tree

4 files changed

+15
-23
lines changed

4 files changed

+15
-23
lines changed

Documentation/git-stash.txt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ SYNOPSIS
1313
'git stash' drop [-q|--quiet] [<stash>]
1414
'git stash' ( pop | apply ) [--index] [-q|--quiet] [<stash>]
1515
'git stash' branch <branchname> [<stash>]
16-
'git stash' save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]
17-
[-u|--include-untracked] [-a|--all] [<message>]
1816
'git stash' [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]
1917
[-u|--include-untracked] [-a|--all] [-m|--message <message>]]
2018
[--] [<pathspec>...]]
@@ -33,7 +31,7 @@ and reverts the working directory to match the `HEAD` commit.
3331
The modifications stashed away by this command can be listed with
3432
`git stash list`, inspected with `git stash show`, and restored
3533
(potentially on top of a different commit) with `git stash apply`.
36-
Calling `git stash` without any arguments is equivalent to `git stash save`.
34+
Calling `git stash` without any arguments is equivalent to `git stash push`.
3735
A stash is by default listed as "WIP on 'branchname' ...", but
3836
you can give a more descriptive message on the command line when
3937
you create one.
@@ -48,7 +46,6 @@ stash index (e.g. the integer `n` is equivalent to `stash@{n}`).
4846
OPTIONS
4947
-------
5048

51-
save [-p|--patch] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [<message>]::
5249
push [-p|--patch] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [-m|--message <message>] [--] [<pathspec>...]::
5350

5451
Save your local modifications to a new 'stash entry' and roll them
@@ -87,6 +84,12 @@ linkgit:git-add[1] to learn how to operate the `--patch` mode.
8784
The `--patch` option implies `--keep-index`. You can use
8885
`--no-keep-index` to override this.
8986

87+
save [-p|--patch] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [<message>]::
88+
89+
This option is deprecated in favour of 'git stash push'. It
90+
differs from "stash push" in that it cannot take pathspecs,
91+
and any non-option arguments form the message.
92+
9093
list [<options>]::
9194

9295
List the stash entries that you currently have. Each 'stash entry' is
@@ -118,7 +121,7 @@ pop [--index] [-q|--quiet] [<stash>]::
118121

119122
Remove a single stashed state from the stash list and apply it
120123
on top of the current working tree state, i.e., do the inverse
121-
operation of `git stash save`. The working directory must
124+
operation of `git stash push`. The working directory must
122125
match the index.
123126
+
124127
Applying the state can fail with conflicts; in this case, it is not
@@ -137,7 +140,7 @@ apply [--index] [-q|--quiet] [<stash>]::
137140

138141
Like `pop`, but do not remove the state from the stash list. Unlike `pop`,
139142
`<stash>` may be any commit that looks like a commit created by
140-
`stash save` or `stash create`.
143+
`stash push` or `stash create`.
141144

142145
branch <branchname> [<stash>]::
143146

@@ -148,7 +151,7 @@ branch <branchname> [<stash>]::
148151
`stash@{<revision>}`, it then drops the `<stash>`. When no `<stash>`
149152
is given, applies the latest one.
150153
+
151-
This is useful if the branch on which you ran `git stash save` has
154+
This is useful if the branch on which you ran `git stash push` has
152155
changed enough that `git stash apply` fails due to conflicts. Since
153156
the stash entry is applied on top of the commit that was HEAD at the
154157
time `git stash` was run, it restores the originally stashed state
@@ -255,14 +258,14 @@ $ git stash pop
255258

256259
Testing partial commits::
257260

258-
You can use `git stash save --keep-index` when you want to make two or
261+
You can use `git stash push --keep-index` when you want to make two or
259262
more commits out of the changes in the work tree, and you want to test
260263
each change before committing:
261264
+
262265
----------------------------------------------------------------
263266
# ... hack hack hack ...
264267
$ git add --patch foo # add just first part to the index
265-
$ git stash save --keep-index # save all other changes to the stash
268+
$ git stash push --keep-index # save all other changes to the stash
266269
$ edit/build/test first part
267270
$ git commit -m 'First part' # commit fully tested change
268271
$ git stash pop # prepare to work on all other changes

Documentation/gitworkflows.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ beginning. It is always easier to squash a few commits together than
4040
to split one big commit into several. Don't be afraid of making too
4141
small or imperfect steps along the way. You can always go back later
4242
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
4444
test suite independent of other uncommitted changes; see the EXAMPLES
4545
section of linkgit:git-stash[1].
4646

Documentation/user-manual.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,7 @@ so on a different branch and then coming back), unstash the
15561556
work-in-progress changes.
15571557

15581558
------------------------------------------------
1559-
$ git stash save "work in progress for foo feature"
1559+
$ git stash push -m "work in progress for foo feature"
15601560
------------------------------------------------
15611561

15621562
This command will save your changes away to the `stash`, and

git-stash.sh

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -260,18 +260,7 @@ push_stash () {
260260
;;
261261
-*)
262262
option="$1"
263-
# TRANSLATORS: $option is an invalid option, like
264-
# `--blah-blah'. The 7 spaces at the beginning of the
265-
# second line correspond to "error: ". So you should line
266-
# up the second line with however many characters the
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'"
263+
eval_gettextln "error: unknown option for 'stash push': \$option"
275264
usage
276265
;;
277266
*)

0 commit comments

Comments
 (0)