Skip to content

Instantly share code, notes, and snippets.

@kinwahlai
Forked from VersionMismatch/stashExporter
Created July 28, 2020 14:06
Show Gist options
  • Save kinwahlai/5dfaba681f6a491d01510b6b832f72e5 to your computer and use it in GitHub Desktop.
Save kinwahlai/5dfaba681f6a491d01510b6b832f72e5 to your computer and use it in GitHub Desktop.
Export git stashes to patch files using the stash name as the file name
git stash list| sed 's/\//\_/g'|sed 's/ /\_/g' | awk -F ":" '{ system("git stash show -p " $1 " >> " $1$2$3 ".diff" ) }'
@kinwahlai
Copy link
Author

kinwahlai commented Jul 28, 2020

git stash list| sed 's/\//\_/g'|sed 's/ /\_/g' | awk -F ":" '{ system("git stash show -p " $1 " >> \"" $1$2$3 ".diff\"" ) }'

this fix the export of stash with description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment