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

[BUG] git stash --keep-index undeletes file

From
CVChristian Vetter <christian@rasenplanscher.info>
Date
Apr 16, 2019, 18:04 UTC
Message-ID
<1555437849815.60450@rasenplanscher.info>
Steps to reproduce
+ mkdir git-stash-test
+ cd git-stash-test
+ git init
+ touch file
+ git add file
+ git commit -m init
+ git rm file
+ git stash push --keep-index
 
 
Result: 
`git status` gives this output:
Show 10 quoted lines
> On branch master
> Changes to be committed:
>   (use "git reset HEAD <file>..." to unstage)
> 
>         deleted:    file
> 
> Untracked files:
>   (use "git add <file>..." to include in what will be committed)
> 
>         file
 
 
Expected: 
`git status` gives this output:
Show 5 quoted lines
> On branch master
> Changes to be committed:
>   (use "git reset HEAD <file>..." to unstage)
> 
>         deleted:    file
 
 
Verified on:
+ Windows 10, git version 2.21.0.windows.1 
+ Ubuntu 14.04, git version 2.21.0
Next: Thomas Gummerer
Message 1 of 4 in “[BUG] git stash --keep-index undeletes file”
  1. Christian VetterApr 16, 2019
  2. Thomas GummererApr 16, 2019
  3. Christian VetterApr 16, 2019
  4. Thomas GummererApr 16, 2019

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.