If I run git stash -u
, I can stash untracked files. However, said untracked files don\'t show up at all with git stash show stash@{0}
. Is there
You can list all stash commits with the following command:
git rev-list -g stash
Since stashes are represented as a 3-way merge commit of HEAD, the index, and a parent-less "root" commit of untracked files, untracked file stashes can be listed by piping the above output into the following:
git rev-list -g stash | git rev-list --stdin --max-parents=0
Useful applications of the above:
git rev-list -g stash | git rev-list --stdin --max-parents=0 | xargs git show --stat
Of course, remove the --stat
to see the contents of the files.
git rev-list -g stash | xargs -n1 git ls-tree -r | sort -u | grep
git rev-list -g stash | git rev-list --stdin --max-parents=0 | xargs git grep
git rev-list -g stash | git rev-list --stdin | xargs git show --stat