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

git stash -u deletes directories containing ignored files

From
CTCyrille Truchot <cyrille.truchot@pird.com>
Date
Sep 1, 2014, 14:08 UTC
Message-ID
<54047DF1.9020800@pird.com>
Hey there,

I'm sure you've already heard about this because this is referenced on the web, but I cannot find anything about it on GitHub in the open issues nor in the fixed ones.

I'm working with Git for Windows, version 1.8.3. The .gitignorefile contains a line like this : 'mydirectory/*'. A new file is added in 'mydirectory' (but it's not showing with git status as it is ignored). Let's say I want to stash several other files (tracked and untracked) and I use git stash -u. The directory 'mydirectory' is then purely deleted, and not stashed. So, unrecoverable.

This happens only if thhe start is present in the .gitignore, because 'mydirectory/' behaves normally.

So is there an open issue about this, or better, maybe it's already fixed in the latest versions ? Thanks in advance for your reply, and many apologies if it's not relevant.

Someone else has described the bug here: http://blog.icefusion.co.uk/git-stash-can-delete-ignored-files-git-stash-u/

Regards, Cyrille

Message 1 of 1 in “git stash -u deletes directories containing ignored files”
  1. Cyrille TruchotSep 1, 2014

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.