git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git stash save -u deletes ignored files without stashing them
@ 2015-12-13  7:51 Michael Brade
  2016-02-04  7:40 ` Kevin Locke
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Brade @ 2015-12-13  7:51 UTC (permalink / raw)
  To: git

Hi,

and it does so if .gitignore has not been committed yet. This is with
git version 2.6.3. To reproduce:

mkdir test
cd test
git init

echo "test" > test
echo "something.txt" > .gitignore

git add test .gitignore
git commit -a -m "init"

mkdir node_modules
echo "something" > node_modules/file.txt
echo "node_modules" >> .gitignore

git stash save -u

Now node_modules will be deleted even though it was ignored at the time
of the "git stash save -u". Apparently .gitignore is reverted first,
then the cleanup is done taking the new state of .gitignore into account
where node_modules is now untracked and not ignored anymore, thus
deleting it.

I think this should be considered a bug that can cause data loss, even
if only in rare cases.

thanks,
  Michael

PS: I'm not subscribed.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-04  7:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-13  7:51 git stash save -u deletes ignored files without stashing them Michael Brade
2016-02-04  7:40 ` Kevin Locke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).