git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: stash push/pop unstages files?

From
Chris Torek <chris.torek@gmail.com>
Date
Sep 5, 2021, 19:19 UTC
Message-ID
<CAPx1GvfEW4rVHjxmmNmAEOVYFgeehbmDQouCWWZx=aiiDy89Vg@mail.gmail.com>
In-Reply-To
<5f09cba9-b7dc-d7b6-1d3f-e7fb8ca28c6c@rawbw.com>
On Sun, Sep 5, 2021 at 12:02 PM Yuri <yuri@rawbw.com> wrote:
> Why 'stash push' and 'stash pop' are asymmetric in what they do by default?
> Wouldn't it make more sense to make 'stash pop' precisely revert what
> 'stash push' does, and have an option '--no-index' instead?

If you ask me, yes, it would—but it would make even *more* sense if `git stash` didn't bother saving the index at all without `--index`, and just errored out if the index and working tree didn't match. But I didn't write `git stash`.

My personal recommendation is: never (or hardly ever) use it. Just make a commit.

Chris
Previous: Yuri
Message 4 of 4 in “stash push/pop unstages files?”
  1. YuriSep 5, 2021
  2. Chris TorekSep 5, 2021
  3. YuriSep 5, 2021
  4. Chris TorekSep 5, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.