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

Fwd: `git stash pop -q` is deleting files.

From
Marce Romagnoli <marce.romagnoli@gmail.com>
Date
Dec 16, 2019, 13:19 UTC
Message-ID
<CA+0NiBEifgam1xVJw7F=mO_DtLgfqK9g7eHJMK5dt3yc1JpaAQ@mail.gmail.com>
In-Reply-To
<CA+0NiBFU46YRBFEbngK+Rc0e4uE_nSqQkYak9a-_UoTaCCb1Jg@mail.gmail.com>

Hi list, this is my first time reporting (what I think is) a bug in git.

WHAT `git stash pop -q` untracks stashed files and others.

WHICH VERSION v2.24.1

HOW-TO REPRODUCE
- Create an empty repository
- Create 2 files, track them and commit.
- Change one of the files
- `git stash`
- `git stash pop -q`
-- Expected: The touched file is back in the index
-- Returned: All the files are no longer tracked.

We use this command on a pre-commit hook and we were scared for the first time we realized all our files were deleted, anyway, it was easy to go back.

Thanks for your time in advance.
Best,
Marcelo Romagnoli
Next: Junio C Hamano
Message 1 of 5 in “Fwd: `git stash pop -q` is deleting files.”
  1. Marce RomagnoliDec 16, 2019
  2. Junio C HamanoDec 16, 2019
  3. Marce RomagnoliDec 17, 2019
  4. Thomas GummererDec 17, 2019
  5. Marce RomagnoliDec 17, 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.