Last active
June 27, 2024 13:42
-
-
Save thalesmg/46f09627ba9d4fbc2750691b2214a77f to your computer and use it in GitHub Desktop.
retag script
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
#!/usr/bin/env bash | |
set -exuo pipefail | |
if [[ $# -lt 3 ]]; then | |
echo "usage: $0 TAG REMOTE BRANCH" | |
return 1 | |
fi | |
tag="$1" | |
remote="$2" | |
branch="$3" | |
git tag -d "$tag" \ | |
&& git push --delete "$remote" "$tag" \ | |
&& git tag "$tag" "$remote/$branch" \ | |
&& git push "$remote" "$tag" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment