{"thread":{"id":"47910","subject":"git stash --keep-index doesn't have the expected behaviour","startedAt":"2018-02-23T08:15:36Z","lastAt":"2018-02-23T08:15:36Z","messageCount":1,"participants":["Daryl Van Den Brink"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"340000","messageId":"CAC4jX8GEg5=9BPepYLntGRG7n_84ju7rTSYO82SQyuiiff0UcQ@mail.gmail.com","threadId":"47910","inReplyTo":null,"subject":"git stash --keep-index doesn't have the expected behaviour","fromName":"Daryl Van Den Brink","fromEmail":"daryl.vandenbrink@maptek.com.au","sentAt":"2018-02-23T08:15:26Z","receivedAt":"2018-02-23T08:15:36Z","isPatch":false,"sender":{"key":"daryl.vandenbrink@maptek.com.au","avatar":null},"body":"If you search the internet for \"git stash only unstaged changes\" you\ncan find much misleading information about what \"git stash\n--keep-index\" does. However, it is my opinion that the --keep-index\noption is broken, in that it doesn't do what 90% of people want it to\ndo - that is, stash only the unstaged changes and not include the\nstaged changes in the stash. You can find many hacks to work around\nthis limitation, none of which are very satisfactory.\n\nIt was pointed out by some commenters on Stack Overflow that the\nexamples given in the documentation at\nhttps://git-scm.com/docs/git-stash imply that the intended behaviour\nof \"git stash --keep-index\" is to stash only the unstaged changes.\nBased on that, they reason that it's actually a bug. I'm not sure\nthat's true, but I find the existing behaviour of \"--keep-index\"\npuzzling because I can't think of when I would use it (whereas\nstashing only unstaged changes is a feature I would frequently use).\n\nIs it possible that --keep-index could be fixed/improved/modified to\nstash only the unstaged changes, or alternatively a new option\nintroduced which does this?\n\n-- \nDaryl van den Brink\nSoftware Engineer\nMaptek | 31 Flemington Street, Glenside, SA 5065, Australia\nTel: +61-8 8338 9222 | Dir: +61-8 8338 9222 | Fax: +61-8 8338 9229\ndaryl.vandenbrink@maptek.com.au | www.maptek.com\n"}]}