Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Convert all stashes to patches in a git repository
stash_count=$(git stash list | wc -l)
while [[ $i -lt $stash_count ]]; do
git stash show -p stash@{$i} > "stash-$i.patch"
i=$(( $i + 1 ))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.