Skip to content

Instantly share code, notes, and snippets.

@thalesmg
Last active June 27, 2024 13:42
Show Gist options
  • Save thalesmg/46f09627ba9d4fbc2750691b2214a77f to your computer and use it in GitHub Desktop.
Save thalesmg/46f09627ba9d4fbc2750691b2214a77f to your computer and use it in GitHub Desktop.
retag script
#!/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