{"thread":{"id":"56001","subject":"Bug: git-stash fails for new file not staged for commit","startedAt":"2021-06-24T15:52:52Z","lastAt":"2026-01-21T13:15:03Z","messageCount":2,"participants":["Claas Augner","Jille Timmermans"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"428383","messageId":"f139a5e1-242a-e23b-6eda-b8b49423d70b@lsp.net","threadId":"56001","inReplyTo":null,"subject":"Bug: git-stash fails for new file not staged for commit","fromName":"Claas Augner","fromEmail":"claas.augner@lsp.net","sentAt":"2021-06-24T15:42:39Z","receivedAt":"2021-06-24T15:52:52Z","isPatch":false,"sender":{"key":"claas.augner@lsp.net","avatar":null},"body":" > What did you do before the bug happened?\n\nI tried to stash a new file that I added with `git add --intent-to-add`:\n\n```\n$ touch foo\n$ git add --intent-to-add foo\n$ git stash\n```\n\n\n > What did you expect to happen?\n\nThe file should have been stashed.\n\n\n > What happened instead?\n\nThe stash failed with the following error message:\n\n```\nerror: Entry 'foo' not uptodate. Cannot merge.\nCannot save the current worktree state\n```\n\n\n > What's different between what you expected and what actually happened?\n\nInstead of stashing the file, the stash fails with an error message.\n\n\n > Anything else you want to add:\n\nBackground: https://github.com/okonet/lint-staged/issues/990\n\n\n[System Info]\ngit version:\ngit version 2.32.0\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Linux 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 \nUTC 2020 x86_64\ncompiler info: gnuc: 9.3\nlibc info: glibc: 2.31\n$SHELL (typically, interactive shell): /usr/bin/zsh\n\n\n[Enabled Hooks]\napplypatch-msg\npre-applypatch\npost-applypatch\npre-commit\nprepare-commit-msg\ncommit-msg\npost-commit\npre-rebase\npost-checkout\npost-merge\npre-push\npre-receive\nupdate\npost-receive\npost-update\npush-to-checkout\npre-auto-gc\npost-rewrite\nsendemail-validate\n\n-------------------------------------------\nLSP.net GmbH\nPrinzregentenstr. 40\n10715 Berlin / Germany\nT +49 30 20896331\nWeb: https://www.LSP.net\nBlog: https://blog.LSP.net\n"},{"id":"534349","messageId":"5a81da1c-1cf7-4966-8be5-67139878a3e0@hexon.nl","threadId":"56001","inReplyTo":"f139a5e1-242a-e23b-6eda-b8b49423d70b@lsp.net","subject":"Re: Bug: git-stash fails for new file not staged for commit","fromName":"Jille Timmermans","fromEmail":"jille@hexon.nl","sentAt":"2026-01-21T12:30:34Z","receivedAt":"2026-01-21T13:15:03Z","isPatch":false,"sender":{"key":"jille@hexon.nl","avatar":null},"body":"On 24-06-2021 17:42, Claas Augner wrote:\n> > What did you do before the bug happened?\n>\n> I tried to stash a new file that I added with `git add --intent-to-add`:\n>\n> ```\n> $ touch foo\n> $ git add --intent-to-add foo\n> $ git stash\n> ```\n>\n>\n> > What did you expect to happen?\n>\n> The file should have been stashed.\n>\n>\n> > What happened instead?\n>\n> The stash failed with the following error message:\n>\n> ```\n> error: Entry 'foo' not uptodate. Cannot merge.\n> Cannot save the current worktree state\n> ```\n>\n>\n> > What's different between what you expected and what actually happened?\n>\n> Instead of stashing the file, the stash fails with an error message.\n>\n>\n> > Anything else you want to add:\n>\n> Background: https://github.com/okonet/lint-staged/issues/990\n>\n>\n> [System Info]\n> git version:\n> git version 2.32.0\nThis bug is still present with git version 2.52.0.\n> cpu: x86_64\n> no commit associated with this build\n> sizeof-long: 8\n> sizeof-size_t: 8\n> shell-path: /bin/sh\n> uname: Linux 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 \n> UTC 2020 x86_64\n> compiler info: gnuc: 9.3\n> libc info: glibc: 2.31\n> $SHELL (typically, interactive shell): /usr/bin/zsh\n>\n>\n> [Enabled Hooks]\n> applypatch-msg\n> pre-applypatch\n> post-applypatch\n> pre-commit\n> prepare-commit-msg\n> commit-msg\n> post-commit\n> pre-rebase\n> post-checkout\n> post-merge\n> pre-push\n> pre-receive\n> update\n> post-receive\n> post-update\n> push-to-checkout\n> pre-auto-gc\n> post-rewrite\n> sendemail-validate\n>\n> -------------------------------------------\n> LSP.net GmbH\n> Prinzregentenstr. 40\n> 10715 Berlin / Germany\n> T +49 30 20896331\n> Web: https://www.LSP.net\n> Blog: https://blog.LSP.net\n>\n"}]}