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

Re: Apparent bug in 'git stash push <subdir>' loses untracked files

From
IDIgor Djordjevic <igor.d.djordjevic@gmail.com>
Date
Dec 13, 2017, 21:20 UTC
Message-ID
<0692d5b8-5fc7-c34c-0712-11a913267441@gmail.com>
In-Reply-To
<CA+HNv10i7AvWXjrQjxxy1LNJTmhr7LE4TwxhHUYBiWtmJCOf_A@mail.gmail.com>
Hi Reid,
On 13/12/2017 18:32, Reid Price wrote:
> 
> When running 'git stash push <subdir>' if there are both tracked and
> untracked files in this subdirectory, the tracked files are stashed
> but the untracked files are discarded.
I can reproduce this as well (git version 2.15.1.windows.2).

For what it`s worth, using `git stash save <subdir>` instead seems to (still) work as expected... but on the other hand, `git-stash`[1] manpage seems not to mention this usage ("save" with "pathspec")?

Regards, Buga
[1] https://git-scm.com/docs/git-stash
Previous: Reid PriceNext: Thomas Gummerer
Message 2 of 10 in “Apparent bug in 'git stash push <subdir>' loses untracked files”
  1. Reid PriceDec 13, 2017
  2. Igor DjordjevicDec 13, 2017
  3. Thomas GummererDec 13, 2017
  4. Igor DjordjevicDec 13, 2017
  5. Thomas GummererDec 13, 2017
  6. Junio C HamanoDec 16, 2017
  7. Thomas GummererDec 17, 2017
  8. Junio C HamanoDec 18, 2017
  9. Thomas GummererJan 5, 2018
  10. stash: don't delete untracked files that match pathspecThomas Gummerer, Jan 6, 2018

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.