threads / discuss / 28762

git stash show doesn't show stashed untracked files

Subject: git stash show doesn't show stashed untracked files

## tl;dr

2 messages between Oct 25, 2011 and Oct 31, 2011.

replies: 1people: 2as markdown or json

Kirill Likhodedov· Oct 25, 2011, 13:21 UTC · lore
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!"

Kirill Likhodedov· Oct 31, 2011, 08:36 UTC · re: Kirill Likhodedov · lore

Re: git stash show doesn't show stashed untracked files

Resending: it seems that the message was lost in discussions.
Show 21 quoted lines
> 
> 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.
> 

← back to recent threads