# [BUG] git stash doesn't use --index as default

1 messages from 2013-10-11 to 2013-10-11. Participants: James.
Thread: https://gitlist.dev/t/35103

## James, 2013-10-11 04:57

Subject: [BUG] git stash doesn't use --index as default
Message-ID: <1381467430.4130.38.camel@freed.purpleidea.com>
URL: https://gitlist.dev/e/1381467430.4130.38.camel%40freed.purpleidea.com

```
As discussed on #git irc:

git init
vim file1
vim file2
git add file1
git add file2
git commit -m 'foo'
vim file1
vim file2
vim file3
vim file4
git add -p file1 # add part of file1, use 'e' to change code too.
git add file2 # add all of file2
git add file3
git stash # do a stash

hack hack hack
git add, commit.

git stash apply
# whoa! all my changes to index are gone!

fail fail... :( sad sad.

git reset HEAD
git stash apply --index

# phew, there are my changes.
git stash apply --index # the --index should be the default!

# WORSE:
if you:
git stash pop
then DATA LOSS. (because you forgot the --index)

Made this super clear. #git agrees this is a bug, if only a UI default
bug. Pretty serious though.

Cheers,

James

PS: please cc me on replies, as I'm not subscribed to list.


```
