List modified file names in a git stash

o0'. picture o0'. · Sep 12, 2014 · Viewed 11.3k times · Source

Can I list the names of the modified files in a stash, without their contents?

While searching, I only found people printing the whole diff, couldn't manage to view the filenames only.

Answer

torek picture torek · Sep 12, 2014

The show sub-command, in the end, invokes git diff with whatever flags you have set, or --stat if you did not set any, so simply git stash show --name-only, which runs git diff --name-only between the base commit and the work-tree commit.

(See here and here for a description of what I have taken to calling a "git stash-bag". You get a diff between the commit the bag hangs from, and the w commit.)