Skip to content

Commit db37745

Browse files
tgummerergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4843cde commit db37745

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

Documentation/git-stash.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ and reverts the working directory to match the `HEAD` commit.
3333
The modifications stashed away by this command can be listed with
3434
`git stash list`, inspected with `git stash show`, and restored
3535
(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`.
3737
A stash is by default listed as "WIP on 'branchname' ...", but
3838
you can give a more descriptive message on the command line when
3939
you create one.
@@ -118,7 +118,7 @@ pop [--index] [-q|--quiet] [<stash>]::
118118

119119
Remove a single stashed state from the stash list and apply it
120120
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
122122
match the index.
123123
+
124124
Applying the state can fail with conflicts; in this case, it is not
@@ -137,7 +137,7 @@ apply [--index] [-q|--quiet] [<stash>]::
137137

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

142142
branch <branchname> [<stash>]::
143143

@@ -148,7 +148,7 @@ branch <branchname> [<stash>]::
148148
`stash@{<revision>}`, it then drops the `<stash>`. When no `<stash>`
149149
is given, applies the latest one.
150150
+
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
152152
changed enough that `git stash apply` fails due to conflicts. Since
153153
the stash entry is applied on top of the commit that was HEAD at the
154154
time `git stash` was run, it restores the originally stashed state
@@ -255,14 +255,14 @@ $ git stash pop
255255

256256
Testing partial commits::
257257

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
259259
more commits out of the changes in the work tree, and you want to test
260260
each change before committing:
261261
+
262262
----------------------------------------------------------------
263263
# ... hack hack hack ...
264264
$ 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
266266
$ edit/build/test first part
267267
$ git commit -m 'First part' # commit fully tested change
268268
$ 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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,11 @@ push_stash () {
267267
# translation of "error: " takes in your language. E.g. in
268268
# English this is:
269269
#
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'"
275275
usage
276276
;;
277277
*)

0 commit comments

Comments
 (0)