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

Bug: git-stash fails for new file not staged for commit

From
CAClaas Augner <claas.augner@lsp.net>
Date
Jun 24, 2021, 15:42 UTC
Message-ID
<f139a5e1-242a-e23b-6eda-b8b49423d70b@lsp.net>
 > What did you do before the bug happened?
I tried to stash a new file that I added with `git add --intent-to-add`:

``` $ touch foo $ git add --intent-to-add foo $ git stash ```

 > What did you expect to happen?
The file should have been stashed.
 > What happened instead?
The stash failed with the following error message:

``` error: Entry 'foo' not uptodate. Cannot merge. Cannot save the current worktree state ```

 > What's different between what you expected and what actually happened?
Instead of stashing the file, the stash fails with an error message.
 > Anything else you want to add:
Background: https://github.com/okonet/lint-staged/issues/990

[System Info] git version: git version 2.32.0 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 compiler info: gnuc: 9.3 libc info: glibc: 2.31 $SHELL (typically, interactive shell): /usr/bin/zsh

[Enabled Hooks] applypatch-msg pre-applypatch post-applypatch pre-commit prepare-commit-msg commit-msg post-commit pre-rebase post-checkout post-merge pre-push pre-receive update post-receive post-update push-to-checkout pre-auto-gc post-rewrite sendemail-validate

-------------------------------------------
LSP.net GmbH
Prinzregentenstr. 40
10715 Berlin / Germany
T +49 30 20896331
Web: https://www.LSP.net
Blog: https://blog.LSP.net
Next: Jille Timmermans
Message 1 of 2 in “Bug: git-stash fails for new file not staged for commit”
  1. Claas AugnerJun 24, 2021
  2. Jille TimmermansJan 21, 2026

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.