Skip to content

Instantly share code, notes, and snippets.

@jancimajek
Last active February 5, 2025 11:45
Show Gist options
  • Save jancimajek/7ad581743fb0356b5731604d0fe2f794 to your computer and use it in GitHub Desktop.
Save jancimajek/7ad581743fb0356b5731604d0fe2f794 to your computer and use it in GitHub Desktop.
Back up stash
# Backup stash messages/titles
git stash list > stashes.txt
# Create patch for each stash entry
NUM_STASHES=$(git stash list | wc -l); for ((i = 0; i < $NUM_STASHES; i++)); do git stash show $i -u -p > stash-$i.patch; done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment