Git: Remove local and remote tag
Sometimes I tagged my Git repo too soon. So from time to time, I need to move a tag from one commit to a newest one.
If you need to remove a tag from your Git repo, you can:
# Remove the remote tag 'v0.28'
$ git push --delete origin v0.28
# Remove the local tag 'v0.28'
$ git tag --delete v0.28
That’s it!
Now if you need to re-tag:
# Set tag 'v0.28' to current commit
$ git tag v0.38
# Push the newly created tag to remote
$ git push origin --tags