Created
July 26, 2018 06:23
-
-
Save deichcode/6c4e35de2f1de6b3074f9055672709f8 to your computer and use it in GitHub Desktop.
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 | |
if [ -z "$1" ] | |
then | |
echo "enter prefix: " | |
read prefix | |
else | |
prefix="$1" | |
fi | |
if [ -z "$2" ] | |
then | |
echo "enter tag: " | |
read tag | |
else | |
tag="$2" | |
fi | |
old=$tag | |
new=$prefix$tag | |
echo "old tag: " $old | |
echo "new tag: " $new | |
read -r -p "Are you sure? [y/N] " response | |
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]] | |
then | |
echo "Renaming tag" | |
git tag $new $old | |
git tag -d $old | |
git push origin :refs/tags/$old | |
git push --tags | |
else | |
echo "Exiting..." | |
fi | |
#Based on: https://gist.github.com/jloveland/22b641ace8e64df189b8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment