Skip to content

Instantly share code, notes, and snippets.

@jrolfs
Last active February 22, 2016 22:31
Show Gist options
  • Save jrolfs/c1dd35eb7cf4c217cad7 to your computer and use it in GitHub Desktop.
Save jrolfs/c1dd35eb7cf4c217cad7 to your computer and use it in GitHub Desktop.
Export all stashed Git states to patches
for s in "${(@f)$(git --no-pager stash list)}"; do git stash show -p $(echo $s | awk -F": " '{print $1}') > "$HOME/Desktop/$(echo $s | awk -F": " '{print $2}' | tr ' ' '-').patch"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment