I understand that we can use
git stash show -p > stash.diff
to take backup of a stash.
Now I want to take backup of at least 20 stashes. What's a good way to take backup of all the stashes?
This snippet will list the IDs of all your existing stashes, and then create separate diff files for each.
for stash in `git stash list | awk -F':' '{print $1}'`
do
git stash show $stash -p > $stash.diff
done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With