Created
March 28, 2019 17:47
-
-
Save ccnokes/64be88797683fd977d61f796c0bae25b to your computer and use it in GitHub Desktop.
Convert all stashes to patches in a git repository
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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