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

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

From
James <purpleidea@gmail.com>
Date
Oct 11, 2013, 04:57 UTC
Message-ID
<1381467430.4130.38.camel@freed.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.
Message 1 of 1 in “[BUG] git stash doesn't use --index as default”
  1. JamesOct 11, 2013

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.