[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    git stash save -u deletes ignored files without stashing them
From:       Michael Brade <brade () kde ! org>
Date:       2015-12-13 7:51:09
Message-ID: 566D236D.5090904 () kde ! org
[Download RAW message or body]

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.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic