2

I'm watching the free lecture on git.
The screen shows me the help message of git stash (by git stash --help). It appears in my terminal like below:

git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]
                    [-u|--include-untracked] [-a|--all] [-m|--message <message>]
                    [--] [<pathspec>...]]

But in the lecture, they use save as a substitute for push. My git version is 2.17.1. Was there some change in the command syntax in git stash?

tripleee
  • 175,061
  • 34
  • 275
  • 318
Jiseong
  • 89
  • 6

2 Answers2

1

@ElpieKay gave the answer in his comment.

quoting git help stash :

save [-p|--patch] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] []

This option is deprecated in favour of git stash push. It differs from "stash push" in that it cannot take pathspecs, and any non-option arguments form the message.

LeGEC
  • 46,477
  • 5
  • 57
  • 104
1

I have documented before the deprecation of git stash save, but Git 2.24 (Q4 2019) adds a clarification.

See commit 57d8f4b (10 Oct 2019) by Johannes Schindelin (dscho).
(Merged by Junio C Hamano -- gitster -- in commit 376012c, 18 Oct 2019)

doc(stash): clarify the description of save

The original phrasing of this paragraph made at least one person stumble over the word "from" (thinking that it was a typo and "from" was intended), and other readers chimed in, agreeing that it was confusing:

Let's rewrite that paragraph for clarity.

The documentation now includes:

save [-p|--patch] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [<message>]:

This option is deprecated in favour of 'git stash push'.
It differs from "stash push" in that it cannot take pathspecs.
Instead, all non-option arguments are concatenated to form the stash message.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250