-1

I use git stash a reasonable amount and then git stash pop to re-apply my changes, typically when I want to do a pull from the remote without losing my changes.

But I saw the command git stash save being used in a similar manner and after reading the git documentation I was non-the-wiser on what it does that git stash does not do.

Can someone explain to me what it does? (please assume I am a simple person :)

code_fodder
  • 15,263
  • 17
  • 90
  • 167
  • seriously, -1 already?....tiresome.... – code_fodder Jul 03 '17 at 10:49
  • 1
    Well it _is_ explained in the documentation. Twice! – Jonathan Wakely Jul 03 '17 at 10:52
  • 1
    @JonathanWakely I did say I looked at it, I specifically read the "save" parameter of the git stash document - and it did not say anything there. So I missed a part of the documentation, yes, sure me making a mistake.... but then that is the point of this forum, for others to help point out our mistakes. That does not make it a poor question though... – code_fodder Jul 03 '17 at 11:24

2 Answers2

2

The synopsis in git help stash shows:

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

This means that if you use the save option you can also specify other options, like a message to use, but if you just say git stash it's the same as save with no other options.

The description for save says:

For quickly making a snapshot, you can omit both "save" and <message>, but giving only <message> does not trigger this action to prevent a misspelled subcommand from making an unwanted stash.

Jonathan Wakely
  • 166,810
  • 27
  • 341
  • 521
1

git stash --help says:

Calling git stash without any arguments is equivalent to git stash save.

Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367