#!/bin/sh # git-rename-tag # NOTE: This works on the "origin" remote and preserves # annotations. set -e # Creates a new tag on the remote AND removes the old tag git push origin refs/tags/$1:refs/tags/$2 :refs/tags/$1 # Remove the old local tag git tag -d $1 # Fetch the new tag git fetch origin refs/tags/$2:refs/tags/$2