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

Re: stash -u deletes ignored files

From
RBRichard Browne <richard@timestone.com.au>
Date
Sep 6, 2012, 00:19 UTC
Message-ID
<0C1F1C86-DFCA-46B6-984A-6FFB82D12A3D@timestone.com.au>
We have been bitten by this bug too. git stash -u is deleting ignored files.
Show 39 quoted lines
> There seems to a bug in git stash. Subfolders with ignored files are
> deleted if the subfolders themselves are not ignored.
> 
> How to reproduce.
> ---
> mkdir TestRepo
> cd TestRepo
> mkdir Ignored
> echo " " > Ignored/Ignored.txt
> echo "Ignored/Ignored.txt" > .gitignore
> echo > File1.txt
> git init
> git add .
> git commit --message="Initial commit"
> echo "Test change" > File1.txt
> git stash -u
> git stash pop
> 
> Expected result:
> Ignored/Ignored1.txt is present in the repository. It is either not
> deleted after stash or at least restored after pop.
> 
> Actual result:
> Ignored is deleted along with any files in it.
> 
> I use git version 1.7.9.msysgit.0
> 
> Sebastian Schuberth could reproduce this as well:
> 
> > I'm able to reproduce this with git version 1.7.10.msysgit.1 as well as
> > on Linux, so please report this upstream to the git mailing list. Thank you.
> 
> Original discussion on msysgit mailing list:
> https://groups.google.com/forum/?fromgroups#!topic/msysgit/FuAh7eXbPSw
> 
> -- 
> Regards,
> Max A. Kiselev
> --
Message 1 of 1 in “Re: stash -u deletes ignored files”
  1. Richard BrowneSep 6, 2012

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.