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

Re: [FEATURE] Proposal: git stash --only-unstaged

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 13, 2025, 15:30 UTC
Message-ID
<xmqqjz37nss7.fsf@gitster.g>
In-Reply-To
<12fe17735317215aa0de58a20055193a@dettweb.de>
"J. Dettweiler" <git.vger.kernel.org@dettweb.de> writes:
Show 19 quoted lines
> **Proposed feature:**
> A new option, for example: git stash push --only-unstaged
>
> ---
>
> This would:
> - Save only the unstaged working tree changes to the stash.
> - Leave the index both in the working directory and completely absent
>   from the stash object.
> - Make `stash pop` safe even if the index has changed in the meantime.
>
> ---
>
> **Benefits:**
> - Cleaner workflows for splitting commits during interactive rebases.
> - Safer testing of staged changes in isolation.
> - Avoids unnecessary conflicts on stash pop.
>
> ---

What is the downside? If the users of "git stash --keep" can keep using the same workflow by switching to this new option, you wouldn't be proposing it as a separate option---rather you would be proposing an improvement to the "--keep" option. So there must be something that the users would have to do differently if they switch to this new "feature", but it is unclear what that is.

Previous: J. DettweilerNext: D. Ben Knoble
Message 2 of 11 in “[FEATURE] Proposal: git stash --only-unstaged”
  1. J. DettweilerAug 13, 2025
  2. Junio C HamanoAug 13, 2025
  3. D. Ben KnobleAug 13, 2025
  4. Phillip WoodAug 16, 2025
  5. Junio C HamanoAug 17, 2025
  6. Phillip WoodAug 18, 2025
  7. Ben KnobleAug 18, 2025
  8. Phillip WoodAug 29, 2025
  9. D. Ben KnobleAug 29, 2025
  10. Phillip WoodSep 16, 2025
  11. D. Ben KnobleSep 16, 2025

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.