30

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.

SQB
  • 3,770
  • 2
  • 26
  • 45
o0'.
  • 11,500
  • 15
  • 59
  • 86

1 Answers1

48

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.)

Community
  • 1
  • 1
torek
  • 389,216
  • 48
  • 524
  • 664
  • If you're having the opposite problem, e.g. YADR shows the names only when you run `git stash show`, try `git stash show --patch`. – Carl G Jun 21 '19 at 11:25