http://stackoverflow.com/questions/11269256/how-to-name-a-stash-in-git
You can actually find the stash by name using git's regular expression syntax for addressing objects:
stash^{/<regex>}
:/<regex>
For example, when saving your stash with a save name:
git stash save "guacamole sauce WIP"
... you can use a regular expression to address that stash:
git stash apply stash^{/guacamo}
This will apply the youngest stash that matches the regular expression guacamo
. That way, you don't have to know what number the stash is at in the stack, you just have to know its name. There is no terser syntax for this, but you can create an alias in your .gitconfig
file:
[alias]
sshow = "!f() { git stash show stash^{/$*} -p; }; f"
sapply = "!f() { git stash apply stash^{/$*}; }; f"
You can then use git sapply <regex>
to apply that stash (without dropping).
You can then use git sshow <regex>
to show: files changed, insertions, and deletions