Skip to content

Instantly share code, notes, and snippets.

@jdforsythe
Created October 28, 2016 13:45
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jdforsythe/3a9916a843b193574f93ec321eec72e9 to your computer and use it in GitHub Desktop.
Save jdforsythe/3a9916a843b193574f93ec321eec72e9 to your computer and use it in GitHub Desktop.
Rename Git Stash
#!/bin/bash
git stash list
echo "Enter stash number to rename"
read stash_number
echo "Enter new name"
read new_name
stash_name="stash@{${stash_number}}"
echo "$stash_name"
rev=$(git rev-parse $stash_name)
git stash drop $stash_name || exit 1
git stash store -m "$new_name" $rev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment