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

git stash show doesn't show stashed untracked files

From
Kirill Likhodedov <kirill.likhodedov@jetbrains.com>
Date
Oct 25, 2011, 13:21 UTC
Message-ID
<5284251B-7265-493B-981D-DD10B80F85B1@jetbrains.com>
Git 1.7.7 introduced a very useful feature - stashing untracked files via "-u" option.

However, there is a problems with it: 'git stash show' doesn't show stashed untracked files.

# git version git version 1.7.7 # touch untracked.txt # git stash save -u # git stash show // no output

If changes in tracked files are stashed along with untracked files, then only tracked changes are shown in "git stash show" output.

Moreover, if I have the same file in the working tree, I wouldn't be able to 'git stash pop': # git stash pop -v untracked.txt already exists, no checkout Could not restore untracked files from stash

In this case the only way to access the stashed content is to remove the tracked file and pop the stash again.

---------------------------------- Kirill Likhodedov JetBrains, Inc http://www.jetbrains.com "Develop with pleasure!"

Next: Kirill Likhodedov
Message 1 of 2 in “git stash show doesn't show stashed untracked files”
  1. Kirill LikhodedovOct 25, 2011
  2. Kirill LikhodedovOct 31, 2011

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.