DEV Community

Discussion on: Need to stash untracked files? There is a way!

Collapse
 
aaronbassett profile image
Aaron Bassett

You can add this alias to have a single command to see both tracked and untracked:

[alias]
    showstash = "!if test -z $1; then set -- 0; fi; git show --stat stash@{$1} && git show --stat stash@{$1}^3 2>/dev/null || echo No untracked files -"

To see all the files in the stash (both tracked and untracked), I added this alias to my config:

showstash = "!if test -z $1; then set -- 0; fi; git show --stat stash@{$1} && git show --stat stash@{$1}^3 2>/dev/null || echo No untracked files -"

It takes a single…