Skip to content

Instantly share code, notes, and snippets.

@ccnokes
Created March 28, 2019 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ccnokes/64be88797683fd977d61f796c0bae25b to your computer and use it in GitHub Desktop.
Save ccnokes/64be88797683fd977d61f796c0bae25b to your computer and use it in GitHub Desktop.
Convert all stashes to patches in a git repository
#!/bin/bash
stash_count=$(git stash list | wc -l)
i=0
while [[ $i -lt $stash_count ]]; do
git stash show -p stash@{$i} > "stash-$i.patch"
i=$(( $i + 1 ))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment